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); }
/// <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; } }
public void Send(SendPackage obj) { _iSocketChannel.Send(obj); }