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;
}