Solved

Programming over a LAN

Posted on 1998-08-27
5
229 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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
C Language combined operators 28 114
thread-safe code in c++ 2 115
How to convert MFC APP to Win32 APP. 19 93
Printing the elements of a set declared inside a map in C++. 3 52
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

809 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