TcpListener.AcceptTcpClient

Drstein99

Well-known member
Joined
Sep 26, 2003
Messages
283
Location
Audubon, Nj
Im using a thread to listen for new tcpclients. It looks like the operation just sits idle and waits for new connections and then continues.

How can i gracefully halt a "listener.AcceptTcpClient" operation?
--------------
Also, I am finding throughout the program, i cant stop or re/start the listener socket its throwing exception 10048 "WSAEADDRINUSE" - which means that address is in use by another listener.

how can i grab ahold of the original one and / or shut it down, dispose, finalize, etc....?
 
Last edited by a moderator:
Ive changed my code to loop through (its a thread). when pending =true it calls the accepttcpclient.

However, the program still operates the same. It only occurs on the windows 98 test platform, where vs.net isnt loaded. Im developing on a windows xp platform.
 
it appears as if my command to call when the READ buffer is populated:

Me.client.GetStream.BeginRead(readBuffer, 0, READ_BUFFER_SIZE, AddressOf StreamReceiver, Nothing)

IS still executing after i closed the client:

client.close

for some reason. it was still open. I have made the following changes, and has made my program run smoother, without the 100048 violation:



client.GetStream.Close()
client.Close()

(when i close connections, and logout - and then decide to log back in)
 
Back
Top