Merged enix's fix (THX enix) and made a little change (because close method dose not work).

This commit is contained in:
sta
2011-06-05 17:39:43 +09:00
parent ab1f09283b
commit fc6ee2db12
25 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Ubuntu" ctype="Workspace" />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" ctype="Workspace" />
<MonoDevelop.Ide.Workbench ActiveDocument="websocket-sharp/WebSocket.cs" ctype="Workbench">
<Files>
<File FileName="websocket-sharp/WebSocket.cs" Line="282" Column="1" />
<File FileName="websocket-sharp/WebSocket.cs" Line="80" Column="19" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
+7 -4
View File
@@ -53,6 +53,8 @@ namespace WebSocketSharp
get { return uri.ToString(); }
}
private Object sync = new Object();
private volatile WsState readyState;
public WsState ReadyState
{
@@ -63,17 +65,18 @@ namespace WebSocketSharp
switch (value)
{
case WsState.OPEN:
readyState = value;
if (OnOpen != null)
{
OnOpen(this, EventArgs.Empty);
}
goto default;
break;
case WsState.CLOSING:
case WsState.CLOSED:
lock(sync)
{
close(value);
break;
default:
readyState = value;
}
break;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -14,11 +14,11 @@ namespace Example
//using (WebSocket ws = new WebSocket("ws://localhost:8000/"))
using (WebSocket ws = new WebSocket("ws://localhost:8000/", "chat"))
{
/*ws.OnOpen += (o, e) =>
ws.OnOpen += (o, e) =>
{
//Do something.
ws.Send("Hi, all!");
};
*/
ws.OnMessage += (o, s) =>
{
#if NOTIFY
Binary file not shown.
Binary file not shown.
Binary file not shown.