Skip to content

Conversation

@shawnliang
Copy link

(This is my first pull request. Please educate me if this request is not good.)

This pull request contains 3 major changes

  1. If user binds web socket server on 0.0.0.0, don't check if "HOST" header matches local ip address because use just want to bind on "any" address.
  2. Port the solution file and project file to vs2011.
  3. On .net 3.5 win 7, calling NetworkStream.Read() often throw this exception: a non-blocking socket operation could not be completed immediately. I tried set TCPClient.Client.blocking = true and TCPClient.ReceiveTimeout = xxx but both failed. So I use Stream.BeginRead() + EndRead() to solve it.

Please kindl

@sta
Copy link
Owner

sta commented Aug 29, 2012

Hi.

I was just about to fix isValidRequest method. I plan to remove checking HOST header and add checking path string instead.

On hold.
I don't use VS2011... :p

Interesting.
I'm wondering if you could explain to me in more detail about in what situations does that exception occur. it's better that there is a code to reproduce it.

@shawnliang
Copy link
Author

For the 3rd item: I run a websocket-sharp server on .net 3.5 win 7 and a client on an android phone using jwebsocket in a Wifi environment. When the android client connects to websocket-sharp server, very often the server triggers onError and onClose events because the mentioned exception is thrown while the server tries to read handshake data. Little chances the connection can be established successfully, but it then fails quickly while server tries to read frames for the same exception.

There is no problem if i use websocket-sharp client on the same win 7.

If you have android, maybe I can provide a test program. I'll also see if I can reproduce it on a mac client or on another windows client. (but you use ubuntu, right?)

sta added a commit that referenced this pull request Sep 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants