Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

LLAPI connection reuse problem

Discussion in 'Multiplayer' started by Zanzibar-Buck-Buck-McFate, Jun 23, 2015.

  1. Zanzibar-Buck-Buck-McFate

    Zanzibar-Buck-Buck-McFate

    Joined:
    Jun 23, 2015
    Posts:
    6
    Hi folks,

    I'm currently working with the new low level API, and things are going reasonably well, except for one problem that I haven't been able to figure out: When I attempt to connect to my server from a client that has previously connected (that is to say, the connection id is reused on the server), my server doesn't receive messages from that new reconnected client. And not just any messages - it receives connect and disconnect events, but not data events. Instead of writing a bunch more prose here, let me just lay things out:
    • Server and client both in Unity.
    • I can connect with multiple clients simultaneously to the server and new connection Ids are generated and used.
    • When I disconnect one of the clients and attempt to relaunch (and reconnect) it, it connects to the server and is able to receive messages, but any data sent to the server is not received.
    • I've bracketed the NetworkTransport.Send and NetworkTransport.Receive calls with logging - no error is set on the client side upon send, but the server isn't receiving.
    • NetworkTransport.Receive is definitely being called in the Update loop (I added logging as I thought I might be crazy).
    • The connection ids on both the client and server side appear to be correct.
    So. This is what I've thought:
    • Since there is no error on the client side NetworkTransport.Send, the problem must be on the server side.
    • Also, since the client is restarted between connection attempts, the only thing that's changed is on the server side (through the previous connection). Thus, the problem must be on the server side.
    • I am nearly positive (I've combed through the code a number of times) that the only stately thing on the server side that is affected by client connections is the storage of a connection object in a dictionary (this holds encryption keys). The connection object is getting removed from the dictionary successfully on disconnect.
    Does anybody have any thoughts? Has anybody experienced this kind of problem? I'm tearing my hair out here.

    Thanks in advance!
     
  2. Zanzibar-Buck-Buck-McFate

    Zanzibar-Buck-Buck-McFate

    Joined:
    Jun 23, 2015
    Posts:
    6
    Oh! Hey, now this is interesting. I looked at the LLAPI sample project (attached to one of the stickies at the top of this forum) and the only real difference was QosType.Reliable, where I'm using QosType.ReliableSequenced. So what the heck, I try Reliable, and voila!

    I'm no networking expert -- can someone enlighten me as to why ReliableSequenced might cause this behaviour?

    Thanks!