Comments (13)
Thanks for taking time in reporting this. I will take a look 👍
from websocketlistener.
I will include a fix for this next week together with other small changes.
from websocketlistener.
Did you by chance catch the actual exception that is thrown at the constructor? (not the one that was caught by the GC).
from websocketlistener.
An exception in the constructor is caught ok. This my code for test:
public WebSocketRfc6455(Stream clientStream ... ) :base(httpRequest, httpResponse)
{
throw new Exception("Test");
if (clientStream == null)
throw new ArgumentNullException("clientStream");
...
}
After starting WebSocketListener, called GC.
WebSocketListener listner = new WebSocketListener(endPoint, options);
...
listner.Start();
Console.ReadKey();
GC.Collect();
When a client connects, the "Test" exception is thrown, and the connection is closing (closing clientStream, but class WebSocketRfc6455 not dispose). Then i press Enter and triggered GC. GC tries to dispose class WebSocketRfc6455, and throwns the exception System.NullReferenceException: Object reference not set to an instance of an object
from websocketlistener.
What I mean is if you caught the original exception that was thrown in the constructor when you discovered this issue first? I am interested in knowing what failed in the constructor that time.
from websocketlistener.
Unfortunately, I do not know what happened at that time. The logs record only preserved this exception.
from websocketlistener.
I believe it has been fixed in: cae9c5e
If you have the chance to get latest source and try it would be great :)
Cheers.
from websocketlistener.
I upgrade my source. Error is not occurred :) But I will still keep an eye.
I have long since found the problem, but I do not know this is a problem in the code or incorrect data.
First. Thrown the exception "Cannot parse cookie string". Cookie data: _ym_isad=2; __test; settings=...
because: The 'Name'='__test; settings' part of the cookie is invalid.
Second. In some websocket frames lacks one byte. I don't have a raw data now. If necessary, i will get later. This problem occurs when you don't use deflate compression.
from websocketlistener.
Sent frames always lack one byte, the final one, that is sent when you close the stream. Deflate frames are different because they are flushed with the DeflateStream as far as I remember.
I can replicate the cookie issue. It was happening before as well. I will put a fix for that today.
from websocketlistener.
It's problem with incoming frames. For example, server receives json data without last symbol "}".
Full exception message:
Cannot parse cookie string: 'language=ru; _ym_uid=1459682501809792379; _ym_isad=2; __test; settings=%7B%22market_730_onPage%22%3A24%7D; timezoneOffset=10800' because: The 'Name'='__test; settings' part of the cookie is invalid.
These are not my cookies. I don't remember what browser, but is real device (not bot). Also I can keep track of this information.
from websocketlistener.
Fixed the cookie thing: 616f257
I am going to review my latest changes to see if I cannot spot that problem you say about missing frames. If you come across a reproducible case let me know.
from websocketlistener.
I have been running a small stress test that creates random JSON objects with random numbers of properties and random values against an echo service with WebSocketListener, and I always get echoed the right object, with both ws:// and wss://
https://gist.github.com/vtortola/eead57d64bf4645c7e91176e2977d920
I think ClientWebSocket
does not use compression, but the tests I have made with the browser always run fine. Keep an eye on it, I would be very interested in finding out what could go wrong, but also review your own code you may have something fishy.
Cheers.
from websocketlistener.
I found an old log with a description of the error.
Message 1 (Pong frame):
Bytes: 8A814FBBE841
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Message 2 (Text frame):
Bytes: 81E935146C9C052517BE466009FD584B05F8172E5BAA00225DAD0C2C5DAE00265DA800265CB0176005F1503656AD01215FAE07215CAB07384EF4546704BE0F363EED637830B3425C04F1547E3FD353401ED0634E0FDD7B5236F7637D2BCA047A58C4504636C9477129AE567B51BE
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
This client had a browser Google Chrome of the latest version (the latest version on January 2016)
from websocketlistener.
Related Issues (20)
- I am trying to upgrade from V2.2.0.1 to V3.0.0 but it errors out. HOT 5
- Does WebSocketListener work with the HoloLens (UWP)? HOT 1
- V3.0.0 does not work with Mono v4.6.2 HOT 3
- How to bypass CORS? HOT 1
- IOException Issues Randomly HOT 1
- IE Origin HOT 2
- WSS Configuration HOT 2
- On quick client disconnect, ObjectDisposedException being thrown HOT 1
- WebSocketMessageReadNetworkStream can only start with a Text or Binary frame, not Continuation HOT 2
- WebSocketHandshaker.ParseWebSocketProtocol throws a NullReferenceException HOT 1
- Server does not detect broken link on linux
- TLS 1.2 is not supported HOT 1
- Cannot understand frame header exception when receiving messages from Javascript HOT 5
- SSL Deserialize Message not working HOT 4
- How to use OnHttpNegotiation in 3.0.0
- Is there a sample including Authentication? HOT 1
- Some Information about Client HOT 1
- Try to Secure WebSocket: Unknow error while processing the certificate
- Is WebSocketListener good enough out of the box for video streaming? HOT 2
- Websocket Listener is able to accept incoming data from Client but Websocket Listener thinks connection with client is closed. HOT 1
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 websocketlistener.