Exemple #1
0
        public bool Send(RdrMsgFormat p)
        {
            try
            {
                byte[] byteData = p.GetPacketBytes();

                UdpCli.Send(byteData, byteData.Length);
                return true;
            }
            catch (Exception ex)
            {
                applog.logexcep("RdrDoorClient: Send()",ex.Message);
                return false;
            }
        }
        private static void SendMsgtoServer(RdrMsgFormat data)
        {
            byte[] byteData = data.GetPacketBytes();

            // Begin sending the data to the remote device.
            client.BeginSend(byteData, 0, byteData.Length, 0,
                new AsyncCallback(SendCallback), client);
        }
        private static void SendMsgtoClient(Socket handler, RdrMsgFormat data)
        {
            byte[] byteData = data.GetPacketBytes();

            // Begin sending the data to the remote device.
            handler.BeginSend(byteData, 0, byteData.Length, 0,
                new AsyncCallback(SendCallback), handler);
        }