public JhTcpServer(int port) { IPAddress ipAddress = IPAddress.Parse("127.0.0.1"); //Dns.Resolve("localhost").AddressList[0]; server = new TcpListener(ipAddress, port); adm = new CommDataMgr(); status = new Parm(this); }
public CommData(JhClient client, MemoryStream stream, int len, CommDataMgr dm) { jhClient = client; Data = new MemoryStream(); stream.WriteTo(Data); dataLen = len; adm = dm; }
public JhClient(CommDataMgr dm) : this(dm, null, null) { }
public JhClient(CommDataMgr dm, TcpClient tcpClient) : this(dm, null, tcpClient) { }
/// <summary> /// ���췽�� /// </summary> /// <param name="dm">�ⲿֲ������ݹ�����</param> /// <param name="ob">�۲���</param> /// <param name="tcpClient">ͨ������</param> public JhClient(CommDataMgr dm, IObserver ob, TcpClient tcpClient) { // // TODO: �ڴ˴���ӹ��캯���� // status = new Parm(this); checkStatus = new Parm(this); autoConnectStatus = new Parm(this); if (dm == null) { adm = new CommDataMgr(); } else adm = dm; if (ob != null) adm.Add(ob); if (tcpClient == null) { client = new TcpClient(); } else client = tcpClient; ID = index++; OnClosed += new CommEventHandler(OnConnectClosed); Console.WriteLine("JH tcp client {0} constructed", ID); }