You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.
When you use Socket.Send you don't add the packet header and just send it as a raw string. So the client doesn't know what to do with it so it just ignores it.
@mahmah2 I was running into the same issue with the client not receiving my packets when using Socket.SendAsync. I was able to get it working using PacketSerialiserProvider.PacketSerialiser.Serialise<T>
Assuming the packet type I'm trying to send was:
public class MyAwesomePacket
{
public int Id { get; set; }
}
Then using the Socket worked:
var socket = .... // code to get the Socket of the client you are wanting to send to.
var packet = new MyAwesomePacket { Id = 1 };
socket.SendAsync(PacketSerialiserProvider.PacketSerialiser.Serialise<MyAwesomePacket>(packet), SocketFlags.None);
For serialization I was using MessagePack.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I have got stuck in a weird situation. I want to initiate a send from the server side to all of the clients. So logically this should work:
But client doesn't receive this command.
Now if I save the server context somewhere and reuse it later it works:
Now this one will work :
What is the correct way of initiating a send from the server. Its not in the example and tests either.
The text was updated successfully, but these errors were encountered: