From be43c9a3435f4eeab8667b128aba8bcec175d8aa Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 4 Aug 2014 20:03:26 +0900 Subject: [PATCH] Modified setClientStream method --- websocket-sharp/WebSocket.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index f830debe..c179f9cf 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -1244,15 +1244,15 @@ namespace WebSocketSharp // As client private void setClientStream () { - var proxy = _proxyUri != null; - _tcpClient = proxy - ? new TcpClient (_proxyUri.DnsSafeHost, _proxyUri.Port) - : new TcpClient (_uri.DnsSafeHost, _uri.Port); - - _stream = _tcpClient.GetStream (); - - if (proxy) + if (_proxyUri != null) { + _tcpClient = new TcpClient (_proxyUri.DnsSafeHost, _proxyUri.Port); + _stream = _tcpClient.GetStream (); sendProxyConnectRequest (); + } + else { + _tcpClient = new TcpClient (_uri.DnsSafeHost, _uri.Port); + _stream = _tcpClient.GetStream (); + } if (_secure) { var sslStream = new SslStream (