SendBytes() public method

This sends an array of bytes on the connection.

public SendBytes ( byte bytes, int numBytes, int channelId ) : bool
bytes byte The array of data to be sent.
numBytes int The number of bytes in the array to be sent.
channelId int The transport channel to send on.
return bool
Ejemplo n.º 1
0
        public void SendBytesTo(int connectionId, byte[] bytes, int numBytes, int channelId)
        {
            NetworkConnection networkConnection = this.FindConnection(connectionId);

            if (networkConnection != null)
            {
                networkConnection.SendBytes(bytes, numBytes, channelId);
            }
        }
Ejemplo n.º 2
0
 public bool SendBytes(byte[] data, int numBytes, int channelId)
 {
     if (m_Connection != null)
     {
         if (m_AsyncConnect != ConnectState.Connected)
         {
             if (LogFilter.logError)
             {
                 Debug.LogError("NetworkClient SendBytes when not connected to a server");
             }
             return(false);
         }
         return(m_Connection.SendBytes(data, numBytes, channelId));
     }
     if (LogFilter.logError)
     {
         Debug.LogError("NetworkClient SendBytes with no connection");
     }
     return(false);
 }