internal static void AsyncRaiseConnected(object sender, IPEndPoint serverEndPoint) { if (Connected == null) { return; } object[] args = { sender, new ConnectedEventArgs(serverEndPoint) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseConnected), args); }
internal static void AsyncRaiseHeartBeatReceived(object sender, IServerSession session) { if (HeartBeatReceived == null) { return; } object[] args = { sender, new HeartBeatReceivedEventArgs(session) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseHeartBeatReceived), args); }
internal static void AsyncRaiseConnecting(object sender, ReconnectArgs reconnectArgs) { if (Connecting == null) { return; } object[] args = { sender, new ConnectingEventArgs(reconnectArgs) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseConnecting), args); }
internal static void AsyncRaiseMessageReceived(object sender, Message msg) { if (MessageReceived == null) { return; } object[] args = { sender, new MessageReceivedEventArgs(msg) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseMessageReceived), args); }
internal static void AsyncRaiseParticipantRemoved(object sender, Multicast multicast, Participant participant, bool isLocal) { if (ParticipantRemoved == null) { return; } object[] args = { sender, new ParticipantEventArgs(multicast, participant, isLocal) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseParticipantRemoved), args); }
internal static void AsyncRaiseReconnectFailed(object sender) { if (ReconnectFailed == null) { return; } object[] args = { sender, new ReconnectFailedEventArgs() }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_ReconnectFailed), args); }
internal static void AsyncRaiseDisconnected(object sender, bool isDropped) { if (Disconnected == null) { return; } object[] args = { sender, new DisconnectedEventArgs(isDropped) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseDisconnected), args); }
internal static void AsyncRaiseClientDisconnectedEvent(object sender, IServerSession session) { object[] args = { sender, new ClientDisconnectedEventArgs(session) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseClientDisconnectedEvent), args); }
internal static void AsyncRaiseRunning(object sender, AnycastServer server) { object[] args = { sender, new RunningEventArgs(server) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseRunning), args); }
/// <summary> /// 异步触发客户端已连接的事件 /// </summary> /// <param name="data"></param> internal static void AsyncRaiseError(object sender, Exception ex) { object[] args = { sender, new ErrorEventArgs(ex) }; AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseError), args); }