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

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
        public virtual bool SendBytes(byte[] bytes, int numBytes, int channelId)
        {
            if (this.logNetworkMessages)
            {
                this.LogSend(bytes);
            }
            return (this.CheckChannel(channelId) && this.m_Channels[channelId].SendBytes(bytes, numBytes));
        }

Usage Example

コード例 #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);
            }
        }
All Usage Examples Of UnityEngine.Networking.NetworkConnection::SendBytes