Exemple #1
0
        public void Send(byte[] bytes)
        {
            if (State != ChannelState.Connected || channel == null)
            {
                throw new InvalidOperationException("Can't send data when the socket is not open");
            }

            channel.Send(bytes);
        }
Exemple #2
0
        /// <summary> Send a message to the connected client </summary>
        /// <param name="message"> The message to send </param>
        public void Send(Message message)
        {
            switch (_messageProtocol)
            {
            case ProtocolType.Auto:
                throw new Exception("The player must be fully connected prior to sending a message.");

            case ProtocolType.Binary:
                _channel.Send(_serializer.Serialize(message));
                break;
            }
        }
Exemple #3
0
 public void Send(SendPackage obj)
 {
     _iSocketChannel.Send(obj);
 }