In its context, the request address is not valid

Problem Description:

***************************************** ** [8:28:19] ***************************************
[ErrorType System.Net.Sockets.SocketException]
[ TargetSite] void DoBind (System.Net.EndPoint, System.Net.SocketAddress)
[Message] in its context, the request address is not valid.
[Source System]
[] StackTrace in System.Net.Sockets.Socket.DoBind (EndPoint endPointSnapshot, SocketAddress socketAddress)
   in System.Net.Sockets.Socket.Bind (EndPoint localEP)
   in SocketLibrary.SocketListener..ctor (EndPoint endpoint, Int32 backlog) positions a

Problem analysis procedure:

Print out the IP address is correct, that is, the service start-up time will have no effect, if Boot and then reinstall the service window is normal,

That is not a good distribution system IP for the computer when the service starts, this IP is assigned a static IP I

Solution:

Add a 10-second delay where the program starts

 // Here sleep for 10 seconds and then start
#if DEBUG!
            Thread.Sleep (10000);
#endif

Reflection:

Feeling for a long time have encountered this kind of problem, it took twelve hours before this in mind, do not become their own hate, light meat, not long long head

Guess you like

Origin www.cnblogs.com/maanshancss/p/11533062.html