本文整理匯總了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 ());
}
}