예제 #1
0
        private void ClientThread(object o)
        {
            TcpClient    client = (TcpClient)o;
            BinaryReader br     = new BinaryReader(client.GetStream());

            while (!_stopClients)
            {
                try
                {
                    HRDMessageBlock msg = HRDMessage.BytesToHRDMessage(br);

                    if (msg.nSize == 0)
                    {
                        break;
                    }

                    HRDTCPEventArgs e = new HRDTCPEventArgs(client, msg);

                    if (HRDTCPEvent != null)
                    {
                        HRDTCPEvent(this, e);
                    }
                }
                catch
                {
                }
            }
            _parent.SetNotifyIconText("MiniDeluxe - Running (" + --_connectionCount + " connections)");
        }
예제 #2
0
        void ServerHRDTCPEvent(object sender, HRDTCPEventArgs e)
        {
            String       s  = e.ToString().ToUpper();
            BinaryWriter bw = new BinaryWriter(e.Client.GetStream());

            s = s.Remove(s.IndexOf('\0'));

#if DEBUG
            //Debug(String.Format("RX: {0}", s));
#endif

            if (s.Contains("GET"))
            {
                ProcessHRDTCPGetCommand(s, bw);
            }
            else if (s.Contains("SET"))
            {
                ProcessHRDTCPSetCommand(s, bw);
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
예제 #3
0
        private void ClientThread(object o)
        {
            TcpClient client = (TcpClient)o;
            BinaryReader br = new BinaryReader(client.GetStream());

            while (!_stopClients)
            {
                try
                {
                    HRDMessageBlock msg = HRDMessage.BytesToHRDMessage(br);

                    if (msg.nSize == 0)
                        break;

                    HRDTCPEventArgs e = new HRDTCPEventArgs(client, msg);

                    if (HRDTCPEvent != null)
                        HRDTCPEvent(this, e);
                }
                catch
                {
                }
            }
            _parent.SetNotifyIconText("MiniDeluxe - Running (" + --_connectionCount + " connections)");
        }
예제 #4
0
        void ServerHRDTCPEvent(object sender, HRDTCPEventArgs e)
        {
            String s = e.ToString().ToUpper();
            BinaryWriter bw = new BinaryWriter(e.Client.GetStream());

            s = s.Remove(s.IndexOf('\0'));

            #if DEBUG
            //Debug(String.Format("RX: {0}", s));
            #endif

            if (s.Contains("GET"))
                ProcessHRDTCPGetCommand(s,bw);
            else if(s.Contains("SET"))
                ProcessHRDTCPSetCommand(s,bw);

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }