Home Forums Support Empty packet receive handler?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2729
    Anonymous
    Inactive

    Hi there,

    i read in the documentation () that you can send empty packets for signaling, which is pretty cool.

    But i haven’t found any suitable AppendIncomingPacketHandler(), so my question is:
    How do i setup a packethandler for those “signaling” packets?

    -Namikon

    #2735
    Anonymous
    Inactive

    Heya Namikon,

    Just create a standard packet handler and expect the incoming object to be null, i.e:

    private static void HandleIncomingMessagePacket(PacketHeader header, Connection connection, string incomingString)
    {
        Console.WriteLine("\n  ... Incoming message from " + connection.ToString() + " saying '" + incomingString + "'.");
    }

    If a signal packet is sent, i.e. a send where there is no send object, expect incomingString to be null.

    Regards,
    Marc

    #2741
    Anonymous
    Inactive

    Awesome, thanks 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.