Well, this is the code. lSocket is a Socket. On the first time i bind the endpoint and te port. And it works perfectly!
VB Code:
lSocket.Bind(New IPEndPoint(Dns.GetHostByName(LocalHostName).AddressList(0).Any, LocalPort)) lSocket.Listen(5) result = lSocket.BeginAccept(AddressOf ConnectionRequest, lSocket) lSocket = result.AsyncState
then, i close the socket and do something like:
VB Code:
lSocket.Close() lSocket = Nothing lSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
And when i bind the socket again, it returns the error:
"Normaly, it's only possible to use once each socket adress".
Dunno why, the bind still there! if i change the port, it works with no problem, but i want the same door. But i can close the socket, destroy it, create it again and bind it.
Any suggestion?![]()




Reply With Quote