UDPPacketIO.SendPacket C# (CSharp) Method

SendPacket() public method

Send a packet of bytes out via UDP.
public SendPacket ( byte packet, int length ) : void
packet byte The packet of bytes to be sent.
length int The length of the packet of bytes to be sent.
return void
    public void SendPacket(byte[] packet, int length)
    {   
        if (!IsOpen())
            Open();
        if (!IsOpen())
            return;
      
        Sender.Send(packet, length, remoteHostName, remotePort);
        Debug.Log("osc message sent to "+remoteHostName+" port "+remotePort+" len="+length);
    }

Usage Example

Exemplo n.º 1
0
    // Send an individual OSC message.  Internally takes the OscMessage object and
    // serializes it into a byte[] suitable for sending to the PacketIO.
    public void Send(OscMessage oscMessage)
    {
        byte[] packet = new byte[1000];
        int    length = OscMessageToPacket(oscMessage, packet, 1000);

        OscPacketIO.SendPacket(packet, length);
    }
All Usage Examples Of UDPPacketIO::SendPacket