Toemsel/Network

Problem when sending a packet from server to client

Masu-Baumgartner opened this issue · 5 comments

In my project a client send a packet to the server when connection is established. This works fine! But when the server sends a packet to the client (triggered by blazor) the client crahses and reconnect. For debugging i logged the connection state every second and it is constantly alive until i send a packet to the client (via sendasync). The connection close reason of the client is "WritePacketThreadException"

Seems like you try to serialize something which results in an error. Can you post the object you try to send?

Its basicly a empty object which should triggers a packet handler on the client. The client make a api call then it sends a response packet with the data from the api call back.

May the empty object cause the error?

No, an empty object is ok. Can you provide a minimalistic example? I cant reproduce your experienced behaviour.

I can provide my code tomorrow.

It sends (in a different thread from the server) a empty class as a packet to trigger a method on the client and awaits the response packet.

Closed due to inactivity