Skip to content

Commit fc6ee2d

Browse files
committed
Merged enix's fix (THX enix) and made a little change (because close method dose not work).
1 parent ab1f092 commit fc6ee2d

25 files changed

+13
-10
lines changed

websocket-sharp.userprefs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Properties>
2-
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Ubuntu" ctype="Workspace" />
2+
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" ctype="Workspace" />
33
<MonoDevelop.Ide.Workbench ActiveDocument="websocket-sharp/WebSocket.cs" ctype="Workbench">
44
<Files>
5-
<File FileName="websocket-sharp/WebSocket.cs" Line="282" Column="1" />
5+
<File FileName="websocket-sharp/WebSocket.cs" Line="80" Column="19" />
66
</Files>
77
</MonoDevelop.Ide.Workbench>
88
<MonoDevelop.Ide.DebuggingService.Breakpoints>

websocket-sharp/WebSocket.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public string Url
5353
get { return uri.ToString(); }
5454
}
5555

56+
private Object sync = new Object();
57+
5658
private volatile WsState readyState;
5759
public WsState ReadyState
5860
{
@@ -63,17 +65,18 @@ private set
6365
switch (value)
6466
{
6567
case WsState.OPEN:
68+
readyState = value;
6669
if (OnOpen != null)
6770
{
6871
OnOpen(this, EventArgs.Empty);
6972
}
70-
goto default;
73+
break;
7174
case WsState.CLOSING:
7275
case WsState.CLOSED:
73-
close(value);
74-
break;
75-
default:
76-
readyState = value;
76+
lock(sync)
77+
{
78+
close(value);
79+
}
7780
break;
7881
}
7982
}
0 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
80 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)