Re: [twsocket] How to return a socket error (Wilfried Mestdagh)
Thank you Gentlemen. After posting my question I tried a few experiments and came to the same conclusion. I appreciate your confirmation. This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] How to return a socket error
Hello: That is a WinSock error, and it is returned automatically by the underlying socket API when a socket is not available to listen on a port. Like Wilfried said, just stop listening on that port and any new connection attempts will receive the 10061 error. I mentioned TWSocketServer because it does this already in a more elegant way: If the maximum number of connections are opened, it will accept the connection, and return a protocol error (e.g. "500 Server is busy.") in the welcome banner and immediately close the connection. dZ. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html On Jan 22, 2008, at 14:19, Bart Thompson wrote: > I am using a TWSocket in an application where it acts like a server > socket (using listen and accept). > > I need to return a 10061 (connection refused error) if there are too > many connections. > > Can anyone tell me how to accomplish this? > > Thanks. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] How to return a socket error
Hello Bart, Just close the listening socket. If nobody is listening winsock will give a 10061. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Tuesday, January 22, 2008, 20:19, Bart Thompson wrote: > I am using a TWSocket in an application where it acts like a server > socket (using listen and accept). > I need to return a 10061 (connection refused error) if there are too > many connections. > Can anyone tell me how to accomplish this? > Thanks. > == > Bart Thompson > Senior Designer > Amdocs > === > This message and the information contained herein is proprietary > and confidential and subject to the Amdocs policy statement, > you may review at http://www.amdocs.com/email_disclaimer.asp -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] How to return a socket error
Hello: Are you creating your own socket server or using TWSocketServer? -dZ. Bart Thompson wrote: > I am using a TWSocket in an application where it acts like a server > socket (using listen and accept). > > I need to return a 10061 (connection refused error) if there are too > many connections. > > Can anyone tell me how to accomplish this? > > Thanks. > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be