Beispiel #1
0
        public TcpWatcherForm(MessageInfoHandle msgHandle)
        {
            InitializeComponent();
            FormHelper.InitHabitToForm(this);
            if (msgHandle == null)
            {
                this.msgHandle = new MessageInfoHandle(ParseMessage);
            }
            else
            {
                this.msgHandle = msgHandle;
            }
            LogHandle log = new LogHandle(Log);

            tcpServerHelper                   = new TcpServerHelper(this.msgHandle, log);
            this.tcpServerHelper.Parent       = this;
            this.tcpServerHelper.ClientClose += new TcpEvent(tcpServerHelper_ClientClose);
            this.tcpServerHelper.ClientConn  += new TcpEvent(tcpServerHelper_ClientConn);

            /*
             * 如果需要给客户端发送消息则使用这个
             * OrgInfo org = new OrgInfo();
             * org.FullName = "XX组织";
             * org.NickName = "xx";
             * org.Telephone = "tel";
             * org.Url = "url";
             * MessageFactory.InitOrg(org);
             */
        }
Beispiel #2
0
 public TcpWatcherForm(MessageInfoHandle msgHandle)
 {
     InitializeComponent();
     FormHelper.InitHabitToForm(this);
     if (msgHandle == null)
     {
         this.msgHandle = new MessageInfoHandle(ParseMessage);
     }
     else
     {
         this.msgHandle = msgHandle;
     }
     LogHandle log = new LogHandle(Log);
     tcpServerHelper = new TcpServerHelper(this.msgHandle, log);
     this.tcpServerHelper.Parent = this;
     this.tcpServerHelper.ClientClose += new TcpEvent(tcpServerHelper_ClientClose);
     this.tcpServerHelper.ClientConn += new TcpEvent(tcpServerHelper_ClientConn);
     /*
     �����Ҫ���ͻ��˷�����Ϣ��ʹ�����
     OrgInfo org = new OrgInfo();
     org.FullName = "XX��֯";
     org.NickName = "xx";
     org.Telephone = "tel";
     org.Url = "url";
     MessageFactory.InitOrg(org);
      */
 }