UnityEngine.Networking.NetworkConnection.TransportSend C# (CSharp) Method

TransportSend() public method

public TransportSend ( byte bytes, int numBytes, int channelId, byte &error ) : bool
bytes byte
numBytes int
channelId int
error byte
return bool
        public virtual bool TransportSend(byte[] bytes, int numBytes, int channelId, out byte error)
        {
            return NetworkTransport.Send(this.hostId, this.connectionId, channelId, bytes, numBytes, out error);
        }

Usage Example

コード例 #1
0
 public bool SendToTransport(NetworkConnection conn, int channelId)
 {
     byte num;
     bool flag = true;
     if (!conn.TransportSend(this.m_Buffer, (ushort) this.m_Position, channelId, out num) && (!this.m_IsReliable || (num != 4)))
     {
         if (LogFilter.logError)
         {
             Debug.LogError(string.Concat(new object[] { "Failed to send internal buffer channel:", channelId, " bytesToSend:", this.m_Position }));
         }
         flag = false;
     }
     if (num != 0)
     {
         if (this.m_IsReliable && (num == 4))
         {
             NetworkDetailStats.IncrementStat(NetworkDetailStats.NetworkDirection.Outgoing, 30, "msg", 1);
             return false;
         }
         if (LogFilter.logError)
         {
             Debug.LogError(string.Concat(new object[] { "Send Error: ", (NetworkError) num, " channel:", channelId, " bytesToSend:", this.m_Position }));
         }
         flag = false;
     }
     this.m_Position = 0;
     return flag;
 }
All Usage Examples Of UnityEngine.Networking.NetworkConnection::TransportSend