PS4 - Pinging servers results in "Socket: accept failed, error: Too many open files" error.

Options
Hey there.

I've recently run into a peculiar issue. I have a place in my game where players can choose which region server they want to connect to. I'm using PhotonPingManager.PingSocket method to ping Photon servers every 10 seconds to be able to display the ping.

After running that ping method a few times on PS4 (build running on the console), the command stops returning ping values and device's console gets flooded with "Socket: accept failed, error: Too many open files(24)" error. I can no longer ping servers until I restart the game.

This issue is not present in the PC build and in Editor set to PS4 platform. I've got PS4 auth all properly set up. All other PUN functions seem to run just fine on PS4.

The full code is below. I made sure it is not run second time until first PingManager is done.

 IEnumerator PingRegionsAsync()
    {
        //ping it
        PhotonPingManager pingManager = new PhotonPingManager();
        foreach (Region region in PhotonNetwork.networkingPeer.AvailableRegions)
        {
            StartCoroutine(pingManager.PingSocket(region));
        }

        while (!pingManager.Done)
        {
            yield return new WaitForSeconds(0.2f); // wait until pinging finished (offline mode won't ping)
        }

        //save to dictionary
        if (PhotonNetwork.networkingPeer != null)
        {
            RegionPings.Clear();
            foreach (Region region in PhotonNetwork.networkingPeer.AvailableRegions)
            {
                if (UsedRegions.Contains(region.Code))
                    RegionPings.Add(region.Code, region.Ping);
            }
        }
    }

Is there something extra I need to do on PS4 to make sure socket connection is disposed of after pinging servers?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2018
    Options
    Hi @Chisely,

    We do not have the right to discuss PS4 details in public.
    Send an email to developer@photonengine.com with a link to this discussion and any other useful information.
This discussion has been closed.