Fix for issue #4

This commit is contained in:
sta
2012-08-18 11:46:07 +09:00
parent ff94d551ff
commit 475d299c3d
45 changed files with 25 additions and 1 deletions

View File

@@ -112,6 +112,30 @@ namespace WebSocketSharp
get { return _extensions; }
}
public bool IsConnected
{
get
{
if (_tcpClient == null) return false;
var socket = _tcpClient.Client;
if (!socket.Connected) return false;
if (socket.Poll(0, SelectMode.SelectWrite) &&
!socket.Poll(0, SelectMode.SelectError))
{
var buffer = new byte[1];
if (socket.Receive(buffer, SocketFlags.Peek) != 0)
{
return true;
}
}
return false;
}
}
public string Protocol
{
get { return _protocol; }

Binary file not shown.