Hello, Ole!
Obut if only one connection is necessary will it then not be better to
Oclose the ListenSocket after that line?
Well, you can close listening socket after receiving one connection.
Nothing bad will happen.
Another option is not calling Socket.Accept(...);
The latter is more flexible, because if you loose that one connection
you can accept another one. And you will not have to do all the bindings again
( Socket.Bind() , Socket.Listen(... ) )
Also the latter option is more secure. Imagine the situation when you've received a connection,
and closed listening socket. In the mean time another application ( malware etc ) binds on the
same address and: a) intercept your clients b)introduce denial-of-service attack
--
Regards, Vadym Stetsyak
www:
http://vadmyst.blogspot.com