ConnectionID bug?

Options
Sergiy
Sergiy
edited June 2012 in Photon Server
Please look: there are two different connections, even how on different ports, but with same ConnectionID - 2. How can it be?

2012-06-22 16:37:56,011 [9] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 217.11.166.61 on port 9998
2012-06-22 16:37:56,027 [14] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 192.168.12.12 on port 9995

Here is full log:
2012-06-22 16:37:55,792 [1] INFO  Photon.SocketServer.Diagnostics.CounterPublisher [(null)] - CounterPublisher started on: 255.255.255.255:40001
2012-06-22 16:37:56,011 [9] DEBUG OperationData [(null)] - OnInit - ConnID=2, data=(41 bytes) F4-00-01-06-01-06-00-00-07-4C-69-76-65-43-61-73-69-6E-6F-52-6F-75-6C-65-74-74-65-00-00-00-00-00-00-00-00-00-00-00-00-00-00
2012-06-22 16:37:56,011 [9] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 217.11.166.61 on port 9998
2012-06-22 16:37:56,027 [14] DEBUG OperationData [(null)] - OnInit - ConnID=2, data=(41 bytes) F3-00-01-06-01-03-00-01-07-4C-69-76-65-43-61-73-69-6E-6F-52-6F-75-6C-65-74-74-65-00-00-00-00-00-00-00-00-00-00-00-00-00-00
2012-06-22 16:37:56,027 [14] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 192.168.12.12 on port 9995
2012-06-22 16:37:56,027 [9] DEBUG Photon.SocketServer.Protocol [(null)] - Parsed init message for application LiveCasinoRoulette, client version 6.0.0, protocol Amf3V2 version 1.6
2012-06-22 16:37:56,027 [14] DEBUG Photon.SocketServer.Protocol [(null)] - Parsed init message for application LiveCasinoRoulette, client version 3.0.1, protocol GpBinaryV2 version 1.6
2012-06-22 16:37:56,042 [9] DEBUG GBSSoft.LiveCasino.Roulette.RoulettePeer [(null)] - Created peer. IP: 217.11.166.61, LoggedIn: Connected, PeerState: 6/22/2012 4:37:56 PM, ConnectionID: 2
2012-06-22 16:37:56,042 [9] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - response sent to ConnId 2 with SendResult Ok
2012-06-22 16:37:56,042 [9] DEBUG OperationData [(null)] - OnInit - ConnID=2, send data=(3 bytes) F4-01-00
2012-06-22 16:37:56,042 [14] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - response sent to ConnId 2 with SendResult Ok
2012-06-22 16:37:56,042 [14] DEBUG OperationData [(null)] - OnInit - ConnID=2, send data=(3 bytes) F3-01-00
2012-06-22 16:37:56,058 [14] DEBUG OperationData [(null)] - OnReceive - ConnID=2, data=(61 bytes) F4-02-01-00-03-04-01-06-49-39-63-33-30-32-31-36-34-2D-63-35-36-34-2D-34-62-37-37-2D-61-61-65-62-2D-34-36-30-61-34-37-63-36-63-65-32-36-04-08-04-00-04-14-06-11-31-2E-30-2E-30-2E-35-31
2012-06-22 16:37:56,214 [12] DEBUG OperationData [(null)] - SentEvent: ConnID=2, evCode=1, ChannelId=1, result=Ok, data=(23 bytes) F4-04-01-00-03-04-01-04-00-04-09-04-81-7B-04-0D-06-0B-42-65-73-6F-43
2012-06-22 16:37:56,230 [12] DEBUG OperationData [(null)] - SentOpResponse: ConnID=2, opCode=1, return=0, ChannelId=1, result=Ok, data=(8 bytes) F4-03-01-00-00-2A-00-00
2012-06-22 16:37:56,246 [9] DEBUG OperationData [(null)] - OnReceive - ConnID=2, data=(60 bytes) F3-02-01-00-03-01-73-00-24-37-37-38-32-33-62-30-64-2D-36-61-62-31-2D-34-64-32-36-2D-39-34-63-38-2D-30-35-62-32-63-37-33-36-65-33-34-62-03-62-FF-02-73-00-08-44-65-62-75-67-67-65-72
2012-06-22 16:37:56,277 [12] DEBUG OperationData [(null)] - SentEvent: ConnID=2, evCode=1, ChannelId=0, result=Ok, data=(11 bytes) F3-04-01-00-01-01-69-00-00-00-00
2012-06-22 16:37:56,277 [12] DEBUG OperationData [(null)] - SentOpResponse: ConnID=2, opCode=1, return=0, ChannelId=0, result=Ok, data=(8 bytes) F3-03-01-00-00-2A-00-00

Comments

  • [Deleted User]
    Options
    Hey Sergiy,

    the ConnectionID and its uniqueness is discussed here http://forum.exitgames.com/viewtopic.php?f=5&t=1631&p=7675&hilit=ConnectionID#p7675. And as you can see
    the connectionID is temporarily unique. Meaning that it is unique for all connected peers. But after a disconnect they can re-used.

    I had a word about that with Tobi and most likely we will remove the Field ConnectionID itself, as one can identify the peer by itself.


    Tim
  • Sergiy
    Options
    Hey Tim

    Thanks for answer. From log you can see that both connections are active while getting the same ConnectionID:
    2012-06-22 16:37:56,011 [9] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 217.11.166.61 on port 9998
    2012-06-22 16:37:56,027 [14] DEBUG Photon.SocketServer.ApplicationBase [(null)] - OnInit - ConnID=2, IP 192.168.12.12 on port 9995
    2012-06-22 16:37:56,027 [9] DEBUG Photon.SocketServer.Protocol [(null)] - Parsed init message for application LiveCasinoRoulette, client version 6.0.0, protocol Amf3V2 version 1.6
    2012-06-22 16:37:56,027 [14] DEBUG Photon.SocketServer.Protocol [(null)] - Parsed init message for application LiveCasinoRoulette, client version 3.0.1, protocol GpBinaryV2 version 1.6
    
    So peers are not disconnected, they initiated connection and get same ConnectionIDs. Am I missing something?

    BTW, please do not remove ConnectionID property. I found it quite useful - to use as a key in dictionaries, to find peer easily with unique ConnectionID etc
  • Tobias
    Options
    The connectionID is not unique, so you can't really use it as lookup for anything. It might be wrong anytime.
    Most likely you have more than one listener? Each listener might assign the same id, so it might exist twice, even at the same time.

    We will remove the connectionID sometime in the future, as it's just not safe to use, sorry. Better work around it now.
    You could use the peer itself as lookup object in a dictionary. Or you can create a guid, store that in the peer and use this in the lookups.
  • Sergiy
    Options
    So the same ConnectionIDs was because of different listeners? 8-) That's OK for me if ConnectionID would be unique for one listener in any given moment of time.

    Again, why remove such handy property without replacing it with something more useful? If somebody will need total uniqueness - he can use Guid.NewGuid() for this purpose. I would definitely opt for remaining ConnectionID :)