SteamKit icon indicating copy to clipboard operation
SteamKit copied to clipboard

Async/await network methods

Open jacobs100500 opened this issue 7 years ago • 3 comments

Do you plan to add an async/await methods to work with the Steam network? When multiple accounts work is not very good to use synchronous methods. And the use of one thread (NetThread in the TcpConnection class) per account, consumes more resources than using async/await.

jacobs100500 avatar Sep 28 '16 17:09 jacobs100500

We have some async/await support in the form of job messages, but this is mostly a developer nicety rather than any form of IO optimization.

Under the hood, we still use a distinct networking thread per client instance.

Is there a specific use case you have where thread-per-client is not scaling very well? I'm not entirely sure if we have any plans to support scaling up the number of clients SteamKit is capable of supporting at once, but it might be something we can investigate in the future.

voided avatar Oct 21 '16 22:10 voided

I run a lot of bots (>100), then created at least 100 threads. All operations of read/write are blocking all this threads. Heartbeat function are blocks the thread every 5 seconds, without regard to other IO operations. Also, the callback manager when wait callback are blocking the main(!!!) thread. Because of this, my program is freezing or crashed on no respond. I rewrote the problem areas using async/await and the problem was solved. I can send the rewrited code.

jacobs100500 avatar Oct 25 '16 11:10 jacobs100500

I'd be interested in this - please 😊

mika76 avatar Nov 04 '16 06:11 mika76