Comments (6)
Could you explain the scenario? Also, be aware that the within the Start() callback, the handshake has not successfully completed; it could be a completely bogus request. It was designed more for setting up the callbacks than anything.
from fleck.
Sure, I'm trying to get SignalR working with Fleck (and I have it working in my fork). Basically I need to subscribe to events based on the request path. Here's what the code looks like:
wss.Start(socket =>
{
PersistentConnection connection;
if (server.TryGetConnection(socket.ConnectionInfo.Path, out connection))
{
var req = new SocketRequest(socket.ConnectionInfo, wss.IsSecure);
var hostContext = new HostContext(req, null, null);
hostContext.Items["Fleck.IWebSocketConnection"] = socket;
try
{
connection.ProcessRequestAsync(hostContext).ContinueWith(task =>
{
Console.WriteLine(task.Exception.GetBaseException());
},
TaskContinuationOptions.OnlyOnFaulted);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
else
{
socket.Close();
}
});
So the scenario is that I need request info to get a specific connection for a path and then subscribe the events.
from fleck.
Makes sense. It's nice to see the ways people are using Fleck.
I took a look at your branch, and I prefer having the initialize passed into the constructor of WebSocketConnection (like here).
If you wouldn't mind rebasing (just pushed a small, but important fix), and writing a test or two, I'll definitely pull in the changes.
from fleck.
Sure, I think I'll do the changes over and write some tests.
Thanks!
from fleck.
Posted the fleck sample here:
https://github.com/davidfowl/SignalR.Fleck
Thanks!
from fleck.
Nice! I'll keep an eye on that. Let me know if any other snags come up.
from fleck.
Related Issues (20)
- should prevent listen socket inherited by subprocess HOT 1
- Error in EnabledSslProtocols Tls13 HOT 4
- Handshake SupportedSubProtocols does not work. HOT 3
- How to find out how many connections are connected to a websocket? HOT 1
- Slow Connection Times?
- net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH HOT 2
- Disposing the server when RestartAfterListenError is true may result in a restarted socket
- Memory leak when sending from the server. HOT 1
- Is this project abandoned? HOT 3
- How to get the websocket connecting a client in server.start() HOT 2
- Question: SSL Client Certificate difference HOT 4
- How to let the session close at end of the prosess by OnMessage, disable.
- Server cannot receive binary data with OnBinary if there is OnMessage
- Custom CipherSuite
- Garbled messages from server
- RobiniaDocs API Explorer
- Hi, boss , why don't upgrade new version of Fleck? thx.
- maximum received message size?
- How to stop this websocket service? HOT 1
- How do I close non-websocket connections?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fleck.