void creat_TCPSever(string local_ip, int local_port, string remote_ip, int remote_port, recieve_message recieve)
 {
     TCPHelper(local_ip, local_port);
 }
示例#2
0
 public asyncTcpClient(recieve_message receive_delegate, int buffer_size)
 {
     this.Message_receive   = receive_delegate;
     this.RecieveBufferSize = buffer_size;
     client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 }
        public static void CreateUDPSever(string local_ip, int local_port, string remote_ip, int remote_port, recieve_message recieve)
        {
            AsyncUdpSever aus = new AsyncUdpSever(local_ip, local_port, remote_ip, remote_port);

            aus.Message_receive = recieve;
            Thread t = new Thread(new ThreadStart(aus.ReceiveMsg));

            t.Priority     = ThreadPriority.Highest;
            t.IsBackground = true;
            t.Start();
        }