dajuric / websocket-rpc Goto Github PK
View Code? Open in Web Editor NEWWebSocket RPC library for .NET with auto JavaScript client code generation, supporting ASP.NET Core
License: Other
WebSocket RPC library for .NET with auto JavaScript client code generation, supporting ASP.NET Core
License: Other
GenerateCallerWithDoc
method assumes that type for which we're generating JS file belongs to current assembly. Which in general case is not true. So as result, in this case no documentation were generated.
Asp.net 2.1 defaults to using https, so the library is not compatible. Plans to update?
So I have been playing around with this library in dotnet core, works great so far, except one thing I can't seem to get to work is how to be notified when a client (console app in my case for now) terminates abnormally. I need to know when a client connection closes (for whatever reason) so that the server end can react to it.
I'm using WebSocketRPC.AspCore v1.0.6, and calling:
`
app.UseWebSockets();
app.MapWebSocketRPC(
new PathString("/webservice"),
(ctx, c) =>
{
try
{
var b = c.Bind<WebService, IWebCallback>(new WebService());
c.OnOpen += async () =>
{
// gets called
};
c.OnClose += async (status, s) =>
{
// does not get called (only when client actually calls Connection.CloseAsync())
};
c.OnError += async ex =>
{
// Also does not get called when client abnormally closes (ie when i kill it)
};
}
catch(Exception ex)
{
}
});
`
I did a quick look at the code and samples and didn't see anything about invoking client-side functions from the server. Is this supported?
There are cases when you need to use RPC from NodeJS, in this case it would be nice to have an option to generate CommonJS
module.
I can not install this NuGet for standart .net project on .Net 4.6.1
It says, that my version is not available :\
Is this lib available only for .Net 4.7? (I'm using visual studio)
Hi Darko,
I realized before that the Standalone package is not directly supporting .NET Standard 2.0 VS projects. That's why I had to create my own project and add your source code manually. Would be a lot smoother if there was a .NET Standard 2 version too.
Thanks
/Anders
and maybe even ensure that call UseWebSockets()
as issued, and call it if it wasn't before.
That will make managing dependencies so much easier and more straightforward.
When a client receives a complex object from the server, the properties of the complex object are all null. Any idea why? Sending plain strings works fine.
var responses = await RPC.For().CallAsync(x => x.LoadPlayer(1234))
var response = responses.First();
response.PlayerName == null?????
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.