Can I auto detect ServerToServer connection port

Options
Masa
Masa
edited February 2017 in Photon Server
Hi I'm developing S2S Code, I know normal way to connect, like this
 protected override PeerBase CreatePeer(InitRequest initRequest)
{
    if (initRequest.LocalPort == 4520)
    {
        // for S2S connections
        return new MyInboundPeer(initRequest);
    }
}

but I wanna auto detect port number like this
    if (this.ServerToServerPorts.contain( initRequest.LocalPort ))
    {
        // for S2S connections
        return new MyInboundPeer(initRequest);
    }

or

if (initRequest.IsS2SConnecttion)
    {
        // for S2S connections
        return new MyInboundPeer(initRequest);
    }
Can do that ?

Comments

  • chvetsov
    Options
    Hi, @Masa

    we do not have anything built-in for this. so, answer to your question is: yes, BUT you should invent how to implement this your self

    best,
    ilya
  • Masa
    Options
    I gotcha.
    Thank you