mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-30 23:51:34 +00:00 
			
		
		
		
	AsyncReply is awaitable
This commit is contained in:
		| @@ -36,8 +36,36 @@ namespace Esiur.Net.HTTP | ||||
| { | ||||
|     public class IIPoWS: HTTPFilter | ||||
|     { | ||||
|         [ResourceProperty] | ||||
|         public DistributedServer DistributedServer | ||||
|         { | ||||
|             get; | ||||
|             set; | ||||
|         } | ||||
|  | ||||
|         public override bool Execute(HTTPConnection sender) | ||||
|         { | ||||
|  | ||||
|             if (DistributedServer == null) | ||||
|                 return false; | ||||
|  | ||||
|             var tcpSocket = sender.Unassign(); | ||||
|  | ||||
|             if (tcpSocket == null) | ||||
|                 return false; | ||||
|  | ||||
|             var httpServer = sender.Parent; | ||||
|             var wsSocket = new WSSocket(tcpSocket); | ||||
|             httpServer.RemoveConnection(sender); | ||||
|  | ||||
|             var iipConnection = new DistributedConnection(); | ||||
|  | ||||
|             DistributedServer.AddConnection(iipConnection); | ||||
|             iipConnection.Assign(wsSocket); | ||||
|             wsSocket.Begin(); | ||||
|  | ||||
|             return true; | ||||
|             /* | ||||
|             if (sender.Request.Filename.StartsWith("/iip/")) | ||||
|             { | ||||
|                 // find the service | ||||
| @@ -73,6 +101,7 @@ namespace Esiur.Net.HTTP | ||||
|             } | ||||
|  | ||||
|             return false; | ||||
|             */ | ||||
|         } | ||||
|  | ||||
|         private void IipConnection_OnReady(DistributedConnection sender) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user