Socket Shut Down Error....

when i push the lock button(iPhone) and then come back to the game again, debug stops temporarily

and if i try to play again this message comes up.

System.Net.Sockets.SocketException: The socket has been shut down
at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.NConnect.SendUdpPackage (System.Byte[] data, Int32 length) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.sendData (System.Byte[] data, Int32 length) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.NConnect.SendUdpPackage (System.Byte[] data, Int32 length) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.EnetPeer.sendData (System.Byte[] data, Int32 length) [0x00000] in <filename unknown>:0
*-* Disconnect Exception *-*

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

the Exception that is from background to foreground hasn't processed yet, i don't know why this message comes up.

i would appreciate if you tell me what should i do in server and client.

Comments

  • Are you using PUN 1.18?

    I will have to take a look at the iOS side of things next week. It's a problem with iOS shutting down any socket immediately when an app goes to the background. I hoped I got this solved but obviously not so.

    "the Exception that is from background to foreground hasn't processed yet"
    I don't understand this part.
  • we are using Photon Server 3.0.37..

    PUN = photon unity networking?
  • PUN = Photon Unity Networking, yes. The package from the Asset Store.
    Or are you using the Photon Unity Client SDK?
  • we are using Photon Unity Client SDK 3.0.1.5..
  • Since v3.0.1.5 a lot has been improved. Please update to the latest version.
    Afaik, it should not break your code or at least just require small adjustments to re-build your app.