Terry, Thanks for the reply. The C++ app is listening on port 6001. When I connect using this port, I do establish a connection (the C++ app is setup, apparently, to send a response when a successful connection is made on the port on which it is listening). So no error specifically. I do see some strange behavior sometimes (the link just seems to drop out and I can't re-establish it without shutting down the host machine) - but that is for another time!
Following on with your helpful comments, Terry, what do I need to do to the host machine's app to make it similar in functionality to, say, PCAnywhere? That is, can I setup the host to 'look' for connections on a range of ports so that I could establish connection from my C# app to multiple hosts? (I will need to rewrite the C++ app at sometime anyway - looking for how best to plan for the rewrite). Peter -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Terry Griffin Sent: Thursday, May 17, 2007 9:48 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] TCP socket Communications Hi Peter, The port number you use for your application should match the port number used by the C++ application. The C++ app will be waiting for a connection on a particular port number. Your app connects to a particular machine (using it's IP address) and the port number used by the C++ app. It is the port number that provides the common connection between you app and the C++ app. You should be able to create multiple sockets for the same port with different IP addresses. What error are you getting when you try to do this? Terry Griffin Sr. Software Engineer ALIS Corporation 10 Technology Drive Peabody, MA 01960 USA [EMAIL PROTECTED] (978) 826-1569 Peter Osucha <[EMAIL PROTECTED]> Sent by: "Discussion of advanced .NET topics." <ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> 05/17/2007 09:40 AM Please respond to "Discussion of advanced .NET topics." <ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> To ADVANCED-DOTNET@DISCUSS.DEVELOP.COM cc Subject [ADVANCED-DOTNET] TCP socket Communications Hello, Perhaps my question would be better served by another list - if so, can you kindly point me to a more appropriate place, please? I am working on a C# app to communicate with other machines on my local network. Each host machine is running a small C++ application (on embeddedXP) and is waiting to be contacted and then controlled by me. My connections involve several NET objects - the main one being the 'Socket' class. I create these Socket objects currently all with the same port number. Apparently (and obviously?), I can't create multiple socket objects that use the same port number with different IP addresses. So I intend to choose from a range of port numbers to open up any Socket objects I need. Being new to trying to effect this type of communication, I do not know how the port for the Socket I open in my C# app (eg, 6001) relates to the port that is opened on the host application (the code for which I can't review at this time). What else do I need to be aware of concerning the port numbers I use with the Socket objects I create, please? Peter =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com