コード例 #1
0
        internal static void AsyncRaiseConnected(object sender, IPEndPoint serverEndPoint)
        {
            if (Connected == null)
            {
                return;
            }

            object[] args = { sender, new ConnectedEventArgs(serverEndPoint) };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseConnected), args);
        }
コード例 #2
0
        internal static void AsyncRaiseHeartBeatReceived(object sender, IServerSession session)
        {
            if (HeartBeatReceived == null)
            {
                return;
            }

            object[] args = { sender, new HeartBeatReceivedEventArgs(session) };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseHeartBeatReceived), args);
        }
コード例 #3
0
        internal static void AsyncRaiseConnecting(object sender, ReconnectArgs reconnectArgs)
        {
            if (Connecting == null)
            {
                return;
            }

            object[] args = { sender, new ConnectingEventArgs(reconnectArgs) };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseConnecting), args);
        }
コード例 #4
0
        internal static void AsyncRaiseMessageReceived(object sender, Message msg)
        {
            if (MessageReceived == null)
            {
                return;
            }

            object[] args = { sender, new MessageReceivedEventArgs(msg) };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseMessageReceived), args);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        internal static void AsyncRaiseReconnectFailed(object sender)
        {
            if (ReconnectFailed == null)
            {
                return;
            }

            object[] args = { sender, new ReconnectFailedEventArgs() };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_ReconnectFailed), args);
        }
コード例 #7
0
        internal static void AsyncRaiseDisconnected(object sender, bool isDropped)
        {
            if (Disconnected == null)
            {
                return;
            }

            object[] args = { sender, new DisconnectedEventArgs(isDropped) };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseDisconnected), args);
        }
コード例 #8
0
 internal static void AsyncRaiseClientDisconnectedEvent(object sender, IServerSession session)
 {
     object[] args = { sender, new ClientDisconnectedEventArgs(session) };
     AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseClientDisconnectedEvent), args);
 }
コード例 #9
0
 internal static void AsyncRaiseRunning(object sender, AnycastServer server)
 {
     object[] args = { sender, new RunningEventArgs(server) };
     AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseRunning), args);
 }
コード例 #10
0
 /// <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);
 }