2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00
This commit is contained in:
2019-11-10 12:41:31 +03:00
parent 8d06fd05ad
commit 5e87ea5247
41 changed files with 2076 additions and 431 deletions

View File

@ -46,25 +46,31 @@ namespace Esiur.Net.HTTP
public override bool Execute(HTTPConnection sender)
{
if (DistributedServer == null)
return false;
if (sender.IsWebsocketRequest())
{
if (DistributedServer == null)
return false;
var tcpSocket = sender.Unassign();
var tcpSocket = sender.Unassign();
if (tcpSocket == null)
return false;
if (tcpSocket == null)
return false;
var httpServer = sender.Parent;
var wsSocket = new WSSocket(tcpSocket);
httpServer.RemoveConnection(sender);
var httpServer = sender.Parent;
var wsSocket = new WSSocket(tcpSocket);
httpServer.RemoveConnection(sender);
var iipConnection = new DistributedConnection();
var iipConnection = new DistributedConnection();
DistributedServer.AddConnection(iipConnection);
iipConnection.Assign(wsSocket);
wsSocket.Begin();
DistributedServer.AddConnection(iipConnection);
iipConnection.Assign(wsSocket);
wsSocket.Begin();
return true;
}
return false;
return true;
/*
if (sender.Request.Filename.StartsWith("/iip/"))
{