SteamKit icon indicating copy to clipboard operation
SteamKit copied to clipboard

Investigate async TCP connection

Open xPaw opened this issue 5 years ago • 2 comments

10:12 <@Netshroud> xPaw: we probably could use Socket.Select to have one thread handle N connections, but I'd rather just switch to async methods and let the thread pool handle it (like websocket does)

Currently, each SK2 connection creates a new thread, so in extreme examples like steamstat.us monitoring, there's a thread for each CM connection (over 200 of them!).

I also noticed sending packets is done on the main thread, and not the thread created for the socket polling/reading.

xPaw avatar Apr 25 '19 08:04 xPaw

I also noticed sending packets is done on the main thread, and not the thread created for the socket polling/reading.

Pretty sure that's intentional, it's done on whatever thread triggered the action. We don't queue them up for the socket reader thread.

yaakov-h avatar Apr 27 '19 12:04 yaakov-h

This is probably no longer really relevant with websockets.

xPaw avatar Mar 21 '23 08:03 xPaw