I see that you got an answer, but I wonder -- Are you sure that you don't want to permit multiple connections from the same machine? Doesn't that mean that two instances of whatever the app is can't be used (as only the first can get connected)?
At a minimum, you may make testing more difficult (or at least requiring more physical machines). At 04:47 AM 8/12/2005, Ragnvald Barth wrote >How do I get the remote IP address from a socket? >I know could use socket.RemoteEndPoint.ToString(), extract the IP part of >it, and create an IPAddress using the Parse method, but that seems a bit >clumsy... > >(I have an application that runs on different machines (one instance at >each machine). The application is regularly broadcasting UDP to the >network while running, so all the instances know about each other. The >application establishes a socket connection to the other instances by >calling Listen and BeginAccept, and accepting an incoming connection >attempt, or by calling Socket.Connect(). Socket.Connect() should only be >called if a connection with a given machine is not yet established. So, >before calling Socket.Connect() I need to test if a connection with the >given machine already exists. How?) J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
