OnConnectionEstablished questions

Hey Photon Team! Long time, no see! So I'm getting back into the swing of things and I'm working on upgrading my Framework to use Photon 4. I have one server connecting to another server using the outboundS2SPeer and I see the connection side getting the connection, setting the client to connected and I see the outbound server getting set to connected.

I'm getting the call to OnConnectionEstablished (used to be CreateServerPeer) and my response object is coming back null. How do i give that function some information. It used to be that CreateServerPeer had an object state that went with it and I was expecting that data to be here but instead I'm getting null and its causing some issues with how i build my peers.

Regards,
Christian - CJR Gaming

Comments

  • Bump!! I get a null object whenever i get a OutboundS2SPeer.OnConnectionEstablished call also.

    Josh
  • hi, @dragagon

    yes, getting null is correct behavior. 'responseObject' contains reference on what was sent back by other side. so, if we have servers A and B, 'A' connects to B. B in its CreatePeer is able to set InitRequet.ResponseObject. Response object might be anything what can be serialized by photon.

    Server A may also send something to B. Method 'ConnectTcp' contains customInitObject parameter. You may use to hand over something to B from A. So that there is no more need in 'Register' operations and stuff like that
    dragagon said:


    I'm getting the call to OnConnectionEstablished (used to be CreateServerPeer) and my response object is coming back null. How do i give that function some information. It used to be that CreateServerPeer had an object state that went with it and I was expecting that data to be here but instead I'm getting null and its causing some issues with how i build my peers.

    not sure what information you are missing. it is all now in your peer. You create peer on server A before establishing of connection to B. when connection is established you get notification 'OnConnectionEstablished' and response object. what else do you need?

    Please check how LoadBalancing code was transformed to get and insperation
    best,
    ilya
  • Ah I see now, thanks this makes perfect sense and means I can rip out my register server operations.

    Cheers