Solved

Programming over a LAN

Posted on 1998-08-27
5
230 Views
Last Modified: 2010-04-10
I want to have a machine on a LAN to run a program in the background.  This program will just sit idle until a certain stream of bits comes over the LAN.  Then an action will take place, similar to sending messages over a LAN in Netware.  I am using VC++.  Is there a prewritten library of functions to assist me with this, ones at a higher level than Winsock, or do I need to start there?  Thanks!
0
Comment
Question by:mitchell042997
5 Comments
 

Expert Comment

by:PSV
ID: 1171459
Please check out wsock sample from MSDN July 96. In one of option it connect a socket
at specified port & then wait for connection from another user asynchronisaly.

Another solution is use Threads
0
 

Expert Comment

by:bdymott
ID: 1171460
You could try UDP. This is similar to TCP but it doesnt require a connection. The MFC CSocket is a good way to use UDP
0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1171461
I need to use TCP/IP.  Thanks, though, for your comment.
0
 
LVL 1

Accepted Solution

by:
gasim earned 100 total points
ID: 1171462
Why don't you use an RPC Server and an RPC client.
They are really easy to program and all TCP/IP connectivity details is totally transparent to you. All you have to supply is the protocol to use and in case of TCP/IP the port number.
Check MSDN for RPC under WIN32 SDK
0
 
LVL 1

Expert Comment

by:gasim
ID: 1171463
Why don't you use an RPC Server and an RPC client.
They are really easy to program and all TCP/IP connectivity details is totally transparent to you. All you have to supply is the protocol to use and in case of TCP/IP the port number.
Check MSDN for RPC under WIN32 SDK.
You can have your program automatically activated when the stream of bits comes by implementing the RPC Server in a service that checks for an incoming stream every second.
There is no overhead in this program since the Main service thread can ideally be completely suspended during inativity.
I can help you and implement the whole Service and RPC Server code if you want (I'm not looking for points, just a have a lot of sapre time...!)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create string splitting user defined function in C++ 23 335
Least Squares Curve Fitting 4 114
Header Errors LNK2019, LNK1120 - Unresolved Externals 4 240
Outlook 13 76
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question