Lidgren.Network.NetConnection.SendMessage C# (CSharp) Method

SendMessage() public method

Send a message to this remote connection
public SendMessage ( NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel ) : NetSendResult
msg NetOutgoingMessage The message to send
method NetDeliveryMethod How to deliver the message
sequenceChannel int Sequence channel within the delivery method
return NetSendResult
        public NetSendResult SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel)
        {
            return m_peer.SendMessage(msg, this, method, sequenceChannel);
        }

Usage Example

 /// <summary>
 /// Sends a message using the specified channel; takes ownership of the NetBuffer, don't reuse it after this call
 /// </summary>
 public void SendMessage(NetBuffer data, NetChannel channel)
 {
     if (m_serverConnection == null || m_serverConnection.Status != NetConnectionStatus.Connected)
     {
         throw new NetException("You must be connected first!");
     }
     m_serverConnection.SendMessage(data, channel);
 }
All Usage Examples Of Lidgren.Network.NetConnection::SendMessage