Mirrory
❔ tls 1.2 serverclient
I'm struggling a lot for something that maybe is very simple.
I have to upgrade a simulator with tls functionality. This simulator is some sort of gateway: starts as a server then sometimes it is tasked to send stuff to various clients
With socket I have no issue. I read everything and when it's time to send I send in chunks using .Send()
For tls I'm using sslstream. Instead of a socket I initialize a tcpListener, listen for it and get the client. From its stream I get the sslstream and then I authenticate as server and I start reading everything with no issue.
When it's time to send I also send in chunks using first write then flush. The client unfortunately just dies and reinits himself. I tried almost everything even with protocol dumps at one point I get an RST and it's over. I also don't think after initializing and finishing the handshake I can go back using socket.
tcpClient.Client is the underlying socket (?) but I don't think I can freely use it
If anyone has an advice most welcome
2 replies
❔ run unknown amount of tasks for some time
I'm using a function async Task<stuff> which returns me an user interaction. Since many users could interact at the same time, how do I run multiple task in parallel without knowing how many for X amount of time?
Doing
Would lose me data
4 replies
❔ Awaiting for multiple interactions DSharp+
I'm using DSharp+ Library
Right now i'm doing this:
but obviously I get the first message and then the code goes through. The expected outcome I want is like set a timer (I can do that) and until then collect all the results (multiple discord users clicking on the buttons) and then at the end of the timer, elaborate the data (I can do that).
I really have no clue on how to do that, I probably need to use tasks or thread but I've never used them. If you can help me and also point me towards some good resources on that I would love it
67 replies