Ejemplo n.º 1
0
 void SetupServer_RecvedRCInfo(object sender, RecvRCInfoEventArgs e)
 {
     if (RecvedRCInfo != null)  //원격제어 요청 수신 구독자가 있을때
     {
         RecvedRCInfo(this, e); //원격제어 요청 수신 이벤트 발생(By Pass)
     }
 }
Ejemplo n.º 2
0
        void Remote_RecvedRCInfo(object sender, RecvRCInfoEventArgs e)
        {
            if (this.InvokeRequired)
            {
                object[] objs = new object[2] {
                    sender, e
                };
                this.Invoke(new Remote_Dele(Remote_RecvedRCInfo), objs);
            }
            else
            {
                txt_controller_ip.Text = e.IPAddressStr;
                sip   = e.IPAddressStr;
                sport = e.Port;

                btn_ok.Enabled = true;
            }
        }
Ejemplo n.º 3
0
 static void AcceptLoop() //연결 요청을 대기하는 메서드를 작성합시다
 {
     try
     {
         while (true)
         {
             Socket do_sock = lis_sock.Accept();
             if (RecvedRCInfo != null) //연결요청 수신 이벤트 핸들러가 있을때
             {
                 //연결 요청을 수신하는 이벤트 핸들러가 있다면 이벤트 인자를 생성하여 이벤트를 발생합니다.
                 RecvRCInfoEventArgs e = new RecvRCInfoEventArgs(do_sock.RemoteEndPoint);
                 RecvedRCInfo(null, e); //이벤트 발생
             }
             do_sock.Close();           //연결 요청을 수신하였는지 알 수 있게 이벤트를 발생했으니 do_sock은 닫습니다.
         }
     }
     catch
     {
         Close();
     }
 }