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

Reply via email to