示例#1
0
 void acceptClient_Error(object sender, string message)
 {
     if (this.IsAccessible)
     {
         AdHocDesktop_AsyncCallback ad = new AdHocDesktop_AsyncCallback(ServerClientErrorCallback);
         this.BeginInvoke(ad, new object[] { message });
     }
 }
示例#2
0
        void server_AcceptClient(AdHocDesktop_TcpClient acceptClient)
        {
            AdHocDesktop_AsyncCallback ad = new AdHocDesktop_AsyncCallback(ServerAcceptClientCallback);

            this.BeginInvoke(ad, new object[] { acceptClient });

            acceptClient.Received += new AdHocDesktop_TcpReceivedEventHandler(acceptClient_Received);
            acceptClient.Error    += new AdHocDesktop_TcpErrorEventHandler(acceptClient_Error);
        }
示例#3
0
        void user_Received(object sender, AdHocDesktop_TcpObject obj)
        {
            try
            {
                AdHocDesktop_AsyncCallback ad;
                object[] objs = obj.Data;
                switch (obj.Command)
                {
                case AdHocDesktop_TcpCommand.ResponseIdentifier:
                    ad = new AdHocDesktop_AsyncCallback(UserConnectCallback);
                    this.BeginInvoke(ad, new object[] { objs });
                    break;

                case AdHocDesktop_TcpCommand.ResponsePeople:
                    ad = new AdHocDesktop_AsyncCallback(UserPeopleCallback);
                    this.BeginInvoke(ad, new object[] { objs });
                    break;

                case AdHocDesktop_TcpCommand.BeginInvitation:
                    ad = new AdHocDesktop_AsyncCallback(UserBeginInvitationCallback);
                    this.BeginInvoke(ad, new object[] { new object[] { objs[0], obj.Src } });
                    break;

                case AdHocDesktop_TcpCommand.EndInvitation:
                    bool accept = (bool)objs[0];
                    if (accept)
                    {
                        ad = new AdHocDesktop_AsyncCallback(UserEndInvitationCallback);
                        this.BeginInvoke(ad, new object[] { obj.Dest });
                    }
                    break;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
        void ReceivedVideo(AdHocDesktop_TcpCommand command, byte[] buffer)
        {
            AdHocDesktop_AsyncCallback ad = new AdHocDesktop_AsyncCallback(ReceivedVideoCallback);

            this.BeginInvoke(ad, new object[] { new object[] { command, buffer } });
        }
        void ReceivedEndSession()
        {
            AdHocDesktop_AsyncCallback ad = new AdHocDesktop_AsyncCallback(ReceivedEndSessionCallback);

            this.BeginInvoke(ad, new object[] { null });
        }
示例#6
0
        void DisconnectClient(AdHocDesktop_TcpClient disconnectClient)
        {
            AdHocDesktop_AsyncCallback ad = new AdHocDesktop_AsyncCallback(ServerDisconnectClientCallback);

            this.BeginInvoke(ad, new object[] { disconnectClient });
        }