I need to send a series of command to a PC server by asyncstream in regular mode. In every command, I write to stream
then close stream and socket then reconnect the client to server. in Client_connected event I enabled timer if the connection is successful.
this method gives different results with different timer intervals. sometimes works as intended but most of the time
do not send commands correctly. I think it is because when I write to asyncstream it's unclear when the write will be completed
How can I know when the write will be completed ?
Do you have better solution to above problem
then close stream and socket then reconnect the client to server. in Client_connected event I enabled timer if the connection is successful.
this method gives different results with different timer intervals. sometimes works as intended but most of the time
do not send commands correctly. I think it is because when I write to asyncstream it's unclear when the write will be completed
How can I know when the write will be completed ?
Do you have better solution to above problem