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
Hello - loving the framework so far. I'm having an issue with connection messages reading back properly. I get an error when getting parameters: "Message contains insufficient unread bytes (14) to read type 'string', result will be truncated!"
Here's an excerpt of what I'm doing on the client side:
because it creates a message with a header and ID, both of which are then included in the actual connect message and considered part of the payload. The receiving end will then interpret those extra bytes as the bytes containing the length of the string, but that's obviously not what they are, so it ends up being completely incorrect. Then it tries to retrieve the string itself, but because it's expecting there to be more bytes than there actually are, you get that error.
The client.Connect method expects a message with nothing in it other than the data you want to send, and you can get an empty message instance like so:
Hello - loving the framework so far. I'm having an issue with connection messages reading back properly. I get an error when getting parameters: "Message contains insufficient unread bytes (14) to read type 'string', result will be truncated!"
Here's an excerpt of what I'm doing on the client side:
private void StartClient()
{
}
On the Server:
private void RemoteDidConnect(object sender, ServerClientConnectedEventArgs e)
{
Debug.Log("Remote Did Connect");
Debug.Log($"Unread: {e.ConnectMessage.UnreadLength}\n" +
$"{e.ConnectMessage.WrittenLength}");
var message = e.ConnectMessage;
Debug.Log($"Test string = {message.GetString()}");
}
Any ideas as to what I am doing incorrectly?
Thanks!
The text was updated successfully, but these errors were encountered: