nlneilson Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
Contributor
A testcase would be useful to see the problem.
"- 2st s.Accept(server) blocks the program"
I am curious how you do that.
Whenever the last return is called:
return "y";
}
#endif
the connection is closed and then a new connection can be made.
If you are in a GetLine() loop then the connection is not broken so a new
if(!s.Connect("127.0.0.1", 11811)) {
with the same address ("127.0.0.1" or whatever) will fail with an error saying that address is in use.
Servers are often set up to accept multiple connections so a different address could be opened. But a basic client with just one address can have only one connection for that address and cannot be opened more than once at the same time.
My thinking may be wrong but I think that is correct.