Fix due to the modified WsStream.cs

This commit is contained in:
sta
2012-09-24 19:52:31 +09:00
parent b9859e08c0
commit 14f16577be
62 changed files with 106 additions and 150 deletions

View File

@@ -29,9 +29,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Principal;
namespace WebSocketSharp.Net {
@@ -40,12 +37,12 @@ namespace WebSocketSharp.Net {
{
private HttpListenerContext _context;
private WebSocket _socket;
private IWsStream _stream;
private WsStream _stream;
internal HttpListenerWebSocketContext(string path, HttpListenerContext context)
{
_context = context;
_stream = WebSocket.CreateServerStream(context);
_stream = WsStream.CreateServerStream(context);
_socket = new WebSocket(path.ToUri(), this);
}
@@ -53,7 +50,7 @@ namespace WebSocketSharp.Net {
get { return _context; }
}
internal IWsStream Stream {
internal WsStream Stream {
get { return _stream; }
}

View File

@@ -29,8 +29,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Principal;
@@ -42,7 +40,7 @@ namespace WebSocketSharp.Net.Sockets {
private bool _isSecure;
private RequestHandshake _request;
private WebSocket _socket;
private IWsStream _stream;
private WsStream _stream;
internal TcpListenerWebSocketContext(TcpClient client)
{
@@ -54,7 +52,7 @@ namespace WebSocketSharp.Net.Sockets {
get { return _client; }
}
internal IWsStream Stream {
internal WsStream Stream {
get { return _stream; }
}
@@ -108,13 +106,10 @@ namespace WebSocketSharp.Net.Sockets {
private void init()
{
_stream = WebSocket.CreateServerStream(_client);
_request = RequestHandshake.Parse(_stream.ReadHandshake());
var port = ((IPEndPoint)_client.Client.LocalEndPoint).Port;
_isSecure = port == 443 ? true : false;
_socket = new WebSocket(this);
_stream = WsStream.CreateServerStream(_client);
_isSecure = _stream.IsSecure;
_request = RequestHandshake.Parse(_stream.ReadHandshake());
_socket = new WebSocket(this);
}
}
}