Home Forums Support AppendIncomingPacketHandler and AppendGlobalIncomingPacketHandler

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2814
    Anonymous
    Inactive

    The AppendIncomingPacketHandler function requires a type to be known at compile time to setup the listener. I have a requirement where the type is only known at runtime. Is there a way to make that work?

    Additionally whats the difference in behavior between the two functions. My architecture requires that there are one-to-many server client connections. Does using the global mean that regardless of which IP is configured , messages of a certain type will always be routed through.

    Cheers

    #2823
    Anonymous
    Inactive

    Heya Bernard,

    Welcome to our forums and many kind thanks for your interest in our network library.

    Any packet handlers that are added using NetworkComms.AppendGlobalIncomingPacketHandler will be active for any current and/or future connections. Connection.AppendIncomingPacketHandler will only be active for the corresponding connection object.

    If you would like to be able to change the types at runtime the simplest solution is to send and receive raw byte arrays, i.e. byte[]. You can then do the type conversion manually yourself.

    Regards,
    Marc

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