Solved

Programming over a LAN

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

758 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

14 Experts available now in Live!

Get 1:1 Help Now