示例#1
0
 public void Init(BeetleX.FastHttpApi.HttpApiServer server)
 {
     mServer = server;
     if (server.WebSocketReceive == null)
     {
         server.WebSocketReceive = OnWebSocketReceive;
     }
 }
示例#2
0
 void IDataResponse.Write(PipeStream stream)
 {
     try
     {
         OnWrite(stream);
     }
     catch (Exception e_)
     {
         HttpApiServer server = Request.Server;
         if (server.EnableLog(EventArgs.LogType.Error))
         {
             server.Log(EventArgs.LogType.Error, $"{Request.RemoteIPAddress} {Request.Method} {Request.Url} response write data error {e_.Message}@{e_.StackTrace}");
             Request.Session.Dispose();
         }
     }
     finally
     {
         Request.Server.OnResponsed(Request, this);
         Request.Recovery();
     }
 }