• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebSocketSharp.CloseEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WebSocketSharp.CloseEventArgs的典型用法代码示例。如果您正苦于以下问题:C# CloseEventArgs类的具体用法?C# CloseEventArgs怎么用?C# CloseEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CloseEventArgs类属于WebSocketSharp命名空间,在下文中一共展示了CloseEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnCloseInternal

 void OnCloseInternal(object sender, CloseEventArgs e)
 {
     if (OnClose != null)
     {
         OnClose(this, e.Reason);
     }
 }
开发者ID:wildbunny,项目名称:c-graphene-api,代码行数:7,代码来源:GrapheneWebsocket.cs


示例2: OnClose

        protected override void OnClose(CloseEventArgs e)
        {
            Program.Users.Remove(User);

            //test
            Program.Chanels.Remove(_test);
        }
开发者ID:pasanzaza,项目名称:Dragonbound,代码行数:7,代码来源:Server.cs


示例3: OnClose

 protected override void OnClose(CloseEventArgs e)
 {
     log_.Info("closed");
     EventHandler<CloseEventArgs> handler = OnCloseEvent;
     if (handler != null)
     {
         handler(this, e);
     }
 }
开发者ID:greggman,项目名称:hft-unity-gamepad,代码行数:9,代码来源:HFTSocket.cs


示例4: OnSocketClose

        void OnSocketClose(object sender, CloseEventArgs e)
        {
            if (_webSocket == null)
            {
                throw new ApplicationException("_webSocket can't be null");
            }

            Log.Write("WARN: RTM websocket closed. Reconnecting in a few seconds...");
            Thread.Sleep(5000);
            ConnectRtm();
        }
开发者ID:seanhussey,项目名称:windows-slack-notifier,代码行数:11,代码来源:RtmConnection.cs


示例5: OnClose

 protected override void OnClose(CloseEventArgs e)
 {
     WSGroupServices.GetLogger().Info("Socket closed");
     foreach (var client in _clients)
     {
         if (!client.Value.IsAlive && DoesFilterMatchIncomingNodeName(client.Key, WSGroupServices.GetFilter()))
         {
             ApplyOnDisconnect(client);
         }
     }
 }
开发者ID:kevoree,项目名称:kevoree-dotnet-group-ws,代码行数:11,代码来源:WSGroupServerWSService.cs


示例6: Client_Close

        private void Client_Close(CloseEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker)delegate {
                    Client_Close(e);
                });
                return;
            }

            status.Text = "Connection closed.";
        }
开发者ID:tewarid,项目名称:NetTools,代码行数:12,代码来源:ClientForm.cs


示例7: OnClose

 protected override void OnClose(CloseEventArgs e)
 {
     Program.Users.Remove(User);
     try
     {
         Channel _chan = Program.Chanels.Single(a => a.UserIn(User) == true);
         if (_chan != null)
         {
             _chan.RemoveUser(User);
         }
     }
     catch { }
 }
开发者ID:JoaquinVautier,项目名称:DragonBound,代码行数:13,代码来源:Server.cs


示例8: OnClose

        protected override void OnClose(CloseEventArgs e) {
            this.isReady = false;

            if (this.onClose != null) {
                this.onClose();
            }

            if (Settings.debug.info) {
                Debug.Log("AirConsole: screen.html disconnected");
            }
           
            base.OnClose(e);
        }
开发者ID:ajgriesemer,项目名称:GameDev,代码行数:13,代码来源:WebsocketListener.cs


示例9: OnClose

		private void OnClose(object sender, CloseEventArgs e)
		{
			EmitEvent("close");
		}
开发者ID:ehackb,项目名称:EHackVisual,代码行数:4,代码来源:SocketIOComponent.cs


示例10: OnClose

 protected override void OnClose(CloseEventArgs e) {
   if(true) {
     X13.Log.Info("{0} Disconnect: [{1}]{2}", this.ToString(), e.Code, e.Reason);
   }
   if(_owner!=null) {
     _owner.Remove();
   }
 }
开发者ID:Wassili-Hense,项目名称:Host.V04f,代码行数:8,代码来源:SIO_Connection.cs


示例11: OnClose

 protected override void OnClose(CloseEventArgs e)
 {
     var msg = String.Format("{0} got logged off...", _name);
       Broadcast(msg);
 }
开发者ID:kallex,项目名称:websocket-sharp,代码行数:5,代码来源:Chat.cs


示例12: OnCloseHandler

 private void OnCloseHandler(object sender, CloseEventArgs e) {
     Debug.Log("WebSocket closed with reason: " + e.Reason);
 }
开发者ID:rjansen,项目名称:unity-ws-demo,代码行数:3,代码来源:Main.cs


示例13: Close

        // As server
        internal void Close(CloseEventArgs args, byte [] frameAsBytes, int waitTimeOut)
        {
            lock (_forClose)
              {
            if (_readyState == WebSocketState.CLOSING || _readyState == WebSocketState.CLOSED)
              return;

            _readyState = WebSocketState.CLOSING;
              }

              args.WasClean = close (frameAsBytes, waitTimeOut, closeServerResources);

              _readyState = WebSocketState.CLOSED;

              OnClose.Emit (this, args);
        }
开发者ID:kevleyski,项目名称:websocket-sharp,代码行数:17,代码来源:WebSocket.cs


示例14: closeAsync

 private void closeAsync (CloseEventArgs e, bool send, bool wait)
 {
   Action<CloseEventArgs, bool, bool> closer = close;
   closer.BeginInvoke (e, send, wait, ar => closer.EndInvoke (ar), null);
 }
开发者ID:greeduomacro,项目名称:uomap-client,代码行数:5,代码来源:WebSocket.cs


示例15: Close

    // As server
    internal void Close (CloseEventArgs e, byte[] frameAsBytes, TimeSpan timeout)
    {
      lock (_forConn) {
        if (_readyState == WebSocketState.Closing) {
          _logger.Info ("The closing is already in progress.");
          return;
        }

        if (_readyState == WebSocketState.Closed) {
          _logger.Info ("The connection has been closed.");
          return;
        }

        _readyState = WebSocketState.Closing;
      }

      e.WasClean = closeHandshake (frameAsBytes, timeout, releaseServerResources);

      _readyState = WebSocketState.Closed;
      try {
        OnClose.Emit (this, e);
      }
      catch (Exception ex) {
        _logger.Fatal (ex.ToString ());
      }
    }
开发者ID:greeduomacro,项目名称:uomap-client,代码行数:27,代码来源:WebSocket.cs


示例16: Close

        // As server
        internal void Close(CloseEventArgs args, byte [] frame, int timeout)
        {
            lock (_forConn) {
            if (_readyState == WebSocketState.Closing || _readyState == WebSocketState.Closed) {
              _logger.Info ("Closing the WebSocket connection has already been done.");
              return;
            }

            _readyState = WebSocketState.Closing;
              }

              args.WasClean = closeHandshake (frame, timeout, closeServerResources);

              _readyState = WebSocketState.Closed;
              try {
            OnClose.Emit (this, args);
              }
              catch (Exception ex) {
            _logger.Fatal (ex.ToString ());
              }
        }
开发者ID:jijamw,项目名称:websocket-sharp,代码行数:22,代码来源:WebSocket.cs


示例17: Socket_OnClose

 private void Socket_OnClose(object sender, CloseEventArgs e)
 {
     LogHelper.Info("Koala连接关闭->" + e.Reason);
     IsConnected = false;
     reset.Set();
 }
开发者ID:ysjr-2002,项目名称:QuickDoor,代码行数:6,代码来源:KoalaSocket.cs


示例18: ws_OnClose

 void ws_OnClose(object sender, CloseEventArgs e)
 {
     Debug.Print("Closed For" + e.Reason);
     listBox1.WFUIize(() => listBox1.Items.Add("Errored: " + e.Reason));
 }
开发者ID:XEonAX,项目名称:Grind,代码行数:5,代码来源:WebSocketClient.cs


示例19: _ws_OnClose

 private void _ws_OnClose(object sender, CloseEventArgs e) {
   if(_verbose.value) {
     if(e.Code==1000) {
       Log.Info("WsSync/{0} - disconnected[{1}]", name, e.Code);
     } else {
       Log.Warning("WsSync/{0} - disconnected[{1}]", name, e.Code);
     }
   }
   _present.value=false;
   if(_st==State.Dispose) {
     _reconn.Change(-1, -1);
     _ws=null;
   }
 }
开发者ID:giapdangle,项目名称:X13.Host,代码行数:14,代码来源:WsSyncPl.cs


示例20: CloseAsync

        /// <summary>
        /// Closes the WebSocket connection asynchronously with the specified
        /// <see cref="CloseStatusCode"/> and <see cref="string"/>, and releases
        /// all associated resources.
        /// </summary>
        /// <remarks>
        ///   <para>
        ///   This method doesn't wait for the close to be complete.
        ///   </para>
        ///   <para>
        ///   This method emits a <see cref="OnError"/> event if the size of <paramref name="reason"/>
        ///   is greater than 123 bytes.
        ///   </para>
        /// </remarks>
        /// <param name="code">
        /// One of the <see cref="CloseStatusCode"/> enum values, represents the status code
        /// indicating the reason for the close.
        /// </param>
        /// <param name="reason">
        /// A <see cref="string"/> that represents the reason for the close.
        /// </param>
        public void CloseAsync(CloseStatusCode code, string reason)
        {
            CloseEventArgs e = null;
              var msg = _readyState.CheckIfClosable () ??
                (e = new CloseEventArgs (code, reason)).RawData.CheckIfValidControlData ("reason");

              if (msg != null) {
            _logger.Error (msg);
            error ("An error has occurred in closing the connection.", null);

            return;
              }

              var send = _readyState == WebSocketState.Open && !code.IsReserved ();
              closeAsync (e, send, send);
        }
开发者ID:khinbaptista,项目名称:OBS-tray,代码行数:37,代码来源:WebSocket.cs



注:本文中的WebSocketSharp.CloseEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebSocketSharp.MessageEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# WebSocket4Net.WebSocket类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap