SteamKit
SteamKit copied to clipboard
Investigate async TCP connection
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.
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.
This is probably no longer really relevant with websockets.