The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

System.Net.Sockets.SocketException (0x80004005): Invalid arguments (v2.17 )

2020-04-15 05:26:28

Upgraded the SDK to the latest (v2.17 ) and when tapped on phone flight mode I get the following Exception instantly and disconnects with DisconnectCause.none

So I reverted back the SDK to 2.13 and it works normally without exception and disconnects after a few seconds later. Which is the normal behaviour in my opinion.

Please correct me if I missed something to add with the new SDK. any new line of code has to be added to make it behave like the old version?


2020-04-16 17:54:43


2020-04-17 10:25:45

Hi @Sathyaraj,

What Unity version do you use?
Does this happen in the Unity Editor or in a build?
What is the target platform?
What is the scripting backend? mono version?

Any chance to have minimal repro steps?
Did you try to reproduce with demo scenes?

2020-04-23 11:11:31

Hi @Sathyaraj,

I have checked with @Tobias.
That exception is caught and logged but should not be re-thrown.
We did not log this in 2.13 or earlier.

The change made here is actually meant to speed up disconnection detection which is what happens when you enable flight mode.
So maybe we need to tweak things and trigger disconnection callback earlier with proper disconnection cause and skip logging this.

2020-04-30 10:21:32

We don't log this as ERROR anymore and the status change SendError is handled in PUN 2.18.
Please update.

2020-04-30 11:59:50

Understood. loud and clear.

2020-04-30 12:27:20

But randomly I get strange issue like I get OnLeftRoom instead of OnDisconnected when flightmode button toggled instantly and say its a 2 players game when player 2 disconnected and reconnected and asks masterclient for the new state, player 1 instance responds with not masterclient.
Player 1 did not getOnMasterClientSwitched call
. These both cases are random.

2020-05-04 05:44:33


2020-06-03 05:13:09

A SocketException is thrown by the Socket and Dns classes when an error occurs with the network. Most of the time these are connectivity issues due to different IP protocols (IPV4/IPV6) between the two server/computers trying to communicate or extra authentication rules setup on one of the computers for in/out connectivity. Ways to troubleshoot this SocketException are, check you have proper internet connection is there on your machine or not, and you are able to ping the remote server or not. Possible causes for the error:

You are using the wrong IP address.
You are using the wrong port.
Firewall blocking the connection.

Back to top