send() публичный Метод

public send ( KBEngine.MemoryStream stream ) : bool
stream KBEngine.MemoryStream
Результат bool
Пример #1
0
        public bool send(MemoryStream stream)
        {
            if (!valid())
            {
                throw new ArgumentException("invalid socket!");
            }

            if (_packetSender == null)
            {
                _packetSender = new PacketSender(this);
            }

            return(_packetSender.send(stream));
        }
Пример #2
0
        public override bool send(PacketSender sender, MemoryStream stream)
        {
            if (!_blowfish.isGood())
            {
                Dbg.ERROR_MSG("BlowfishFilter::send: Dropping packet, due to invalid filter");
                return(false);
            }

            encrypt(stream);
            return(sender.send(stream));
        }
        public bool send(byte[] datas)
        {
            if (!valid())
            {
                throw new ArgumentException("invalid socket!");
            }

            if (_packetSender == null)
            {
                _packetSender = new PacketSender(this);
            }

            try
            {
                return(_packetSender.send(datas));
            }
            catch (SocketException err)
            {
                Dbg.ERROR_MSG(string.Format("NetworkInterface::send(): socket error(" + err.ErrorCode + ")!"));
                close();
            }

            return(false);
        }