Solved

Programming over a LAN

Posted on 1998-08-27
5
220 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now