radu-matei / websocket-manager

Real-Time library for ASP .NET Core
https://radu-matei.com/blog/real-time-aspnet-core/
MIT License
452 stars 183 forks source link

Client no longer crashes when a method is called that doesn't exist. #60

Closed Henry00IS closed 6 years ago

Henry00IS commented 6 years ago

The client has to register all methods with Connection.On, it will throw dictionary exceptions if the server sends an unexpected method and kill the connection. Now they will be simply ignored instead.

(This is identical to the server behavior of unknown commands)

RobSchoenaker commented 6 years ago

Thx Henry. Good catch. I modified your code slightly to short circuit the logic

radu-matei commented 6 years ago

Thanks for the contributions @Henry00IS!

@RobSchoenaker - appreciate you taking a look at this!

Henry00IS commented 6 years ago

Sure thing! I need this library for work and SignalR didn't compile and I like this even better. I actually went ahead and completely rewrote most of it. I have client->server and server->client method calls with reflection and everything. But I figured I should at least contribute what I can of original code changes. Please merge this PR sometime, without it I wouldn't be using this library (it was too broken).

radu-matei commented 6 years ago

@Henry00IS - people that have been contributing one way or another to this project have review and merging rights to this repo (each PR must have at least one review from somebody else, so there's no chance of merging your own PRs) - I sent you an invite to contribute here directly, as I think the project will surely benefit from your work!

Henry00IS commented 6 years ago

@radu-matei That's awesome! Thank you so much! I will probably finish my aforementioned work and make an über PR for it. I think you'll like it. I guess we shouldn't write here too much. Poor e-mail watchers. ;)