Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
        internal static void AsyncRaiseReconnectFailed(object sender)
        {
            if (ReconnectFailed == null)
            {
                return;
            }

            object[] args = { sender, new ReconnectFailedEventArgs() };
            AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_ReconnectFailed), args);
        }
Exemplo n.º 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);
        }
Exemplo n.º 8
0
 internal static void AsyncRaiseClientDisconnectedEvent(object sender, IServerSession session)
 {
     object[] args = { sender, new ClientDisconnectedEventArgs(session) };
     AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseClientDisconnectedEvent), args);
 }
Exemplo n.º 9
0
 internal static void AsyncRaiseRunning(object sender, AnycastServer server)
 {
     object[] args = { sender, new RunningEventArgs(server) };
     AnycastEventThrower.QueueUserWorkItem(new RaiseEvent(_RaiseRunning), args);
 }
Exemplo n.º 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);
 }