本文整理汇总了C#中WebSocketSharp.CloseEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CloseEventArgs类的具体用法?C# CloseEventArgs怎么用?C# CloseEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CloseEventArgs类属于WebSocketSharp命名空间,在下文中一共展示了CloseEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCloseInternal
void OnCloseInternal(object sender, CloseEventArgs e)
{
if (OnClose != null)
{
OnClose(this, e.Reason);
}
}
示例2: OnClose
protected override void OnClose(CloseEventArgs e)
{
Program.Users.Remove(User);
//test
Program.Chanels.Remove(_test);
}
示例3: OnClose
protected override void OnClose(CloseEventArgs e)
{
log_.Info("closed");
EventHandler<CloseEventArgs> handler = OnCloseEvent;
if (handler != null)
{
handler(this, e);
}
}
示例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();
}
示例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);
}
}
}
示例6: Client_Close
private void Client_Close(CloseEventArgs e)
{
if (InvokeRequired)
{
Invoke((MethodInvoker)delegate {
Client_Close(e);
});
return;
}
status.Text = "Connection closed.";
}
示例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 { }
}
示例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);
}
示例9: OnClose
private void OnClose(object sender, CloseEventArgs e)
{
EmitEvent("close");
}
示例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();
}
}
示例11: OnClose
protected override void OnClose(CloseEventArgs e)
{
var msg = String.Format("{0} got logged off...", _name);
Broadcast(msg);
}
示例12: OnCloseHandler
private void OnCloseHandler(object sender, CloseEventArgs e) {
Debug.Log("WebSocket closed with reason: " + e.Reason);
}
示例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);
}
示例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);
}
示例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 ());
}
}