-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentOutOfRangeException from HandleData method #1
Comments
Hi @uxiaoyao , which version of Unity were you using? Thanks |
I'm using 2013.3.13f1c1 |
Hi @viglucci I just found that the error happened when do a "RequestRepsonse" for a message which is a fire and forget message. |
Thanks for that additional information @uxiaoyao . Can you help me understand better what you mean by the below?
Did you try sending a If this is still an issue for you, it would be helpful if you could provide a reference to a repository that demonstrates the issue or provide relevant code examples from your client and server. Thanks. |
Yes, that's what i mean, my code below: void RequestResponse(IMessage message, Action<List<byte>> cb)
{
var builder = new CompositeMetadataBuilder();
builder.Route("account.login.session");
ICancellable cancellable = _rSocket.RequestResponse(new RSocketPayload { Data = Serialize(message), Metadata = builder.Build() },
new Subscriber((payload, isComplete) =>
{
string decodedData = Encoding.UTF8.GetString(payload.Data.ToArray());
string decodedMetadata = Encoding.UTF8.GetString(payload.Metadata.ToArray());
cb.Invoke(payload.Data);
/*Debug.Log($"data: {response}");
Debug.Log($"metadata: {decodedMetadata}");
Debug.Log($"isComplete: {isComplete}");*/
if (isComplete)
{
Debug.Log("RequestResponse done");
}
},
() =>
{
Debug.Log("RequestResponse done");
},
(e) =>
{
cb.Invoke(null);
Debug.LogError(e);
}
));
}
public IAsyncResult<T> Request<T>(IMessage msg) where T : IMessage<T>
{
AsyncResult<T> result = new AsyncResult<T>();
RequestResponse(msg, (data) =>
{
Loom.QueueOnMainThread(() => {
var parser = typeof(T).GetProperty("Parser").GetValue(null) as MessageParser<T>;
//var parser = typeof(T).GetProperty("Parser") as MessageParser<T>;
//var parser = new MessageParser<T>(() => (T)Activator.CreateInstance(typeof(T)));
T res = parser.ParseFrom(data.ToArray());
result.SetResult(res);
});
});
return result;
}
public async void GetSession()
{
SessionLoginRequest msg = new();
msg.SessionId = "";
var isDone = await this.Request(msg);
Debug.Log("* SessionLoginRequest:");
Debug.Log("isDone: " + isDone);
} the error happened when i called GetSession method. |
The text was updated successfully, but these errors were encountered: