Forum Mobile Can't connect when using cellular data

Anything specifically relating to droid or iOS development with Unity can go here.

Can't connect when using cellular data

Postby Bestlis » November 21st, 2022, 2:07 pm

Hello, Henrik!
I have an issue with connection when I use cellular data.

Code: Select all
void ConnectServer()
{
   PlayerIO.UseSecureApiRequests = true;

   PlayerIO.Authenticate(Settings.game_id, "Public", new Dictionary<string, string> { { "userId", Settings.PRIMARY_CODE } }, null,
   delegate (Client cl)
   {
      if (isDebug)
         Debug.Log("Connected to server!");
      this.cl = cl;
      
      CreateRoom();
   },
   delegate (PlayerIOError er)
   {
      print("ConnectServer Error: " + er.ToString());
      Invoke("ConnectServer", 1f);
   });
}


//connecting to select room
void CreateRoom()
{
   if (isDebug)
      print("connecting to room...");
   cl.Multiplayer.CreateJoinRoom("START_" + Settings.PRIMARY_CODE, "StartRoom", true, null, null,
   delegate (Connection con)
   {
      if (isDebug)
         Debug.Log("Connected to room!");

      this.con = con;
      this.con.OnMessage += new MessageReceivedEventHandler(con_OnMessage);
      this.con.OnDisconnect += new DisconnectEventHandler(con_OnDisconnect);
      OnConnected();

      IsTryingConnect = false;

      if (!info_received)
      {
         GetCurrentLocation();

         //BestlisAnalyticManager.getUserLocationInfo();
      }

      RefreshBonuses();

      Invoke("SendAppInformation", 1f);
   },
   delegate (PlayerIOError er)
   {
      print("CreateRoom Error: " + er);
      Invoke("CreateRoom", 1f);
   });
}


Here is logcat:
Code: Select all
11-14 10:57:46.910 20457 20521 I Unity   : Connected to server!
11-14 10:57:46.910 20457 20521 I Unity   : StartConnectionScript:<ConnectServer>b__30_0(Client)
11-14 10:57:46.910 20457 20521 I Unity   : PlayerIOClient.PlayerIO:authSuccess(Client, identifier175, List`1, Callback`1, Callback`1)
11-14 10:57:46.910 20457 20521 I Unity   : PlayerIOClient.Internal.identifier911:MoveNext()
11-14 10:57:46.910 20457 20521 I Unity   : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
11-14 10:57:46.910 20457 20521 I Unity   :
11-14 10:57:46.910 20457 20521 I Unity   : connecting to room...
11-14 10:57:46.910 20457 20521 I Unity   : StartConnectionScript:CreateRoom()
11-14 10:57:46.910 20457 20521 I Unity   : PlayerIOClient.PlayerIO:authSuccess(Client, identifier175, List`1, Callback`1, Callback`1)
11-14 10:57:46.910 20457 20521 I Unity   : PlayerIOClient.Internal.identifier911:MoveNext()
11-14 10:57:46.910 20457 20521 I Unity   : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
11-14 10:57:46.910 20457 20521 I Unity   :


It is connected to the server but can't create room.
When I use WiFi everything works fine.

Can anybody tell me what the problem is?

Update: I think I found the problem's reason: unity3d plugin doesn't support Ipv6 protocol connection.
Are there any plans to implement Ipv6 protocol support for unity3d plugin?

I created an android native app with PlayerIO.aar library and it can connect to the server and create room. If I use playerIO for unity3d it can connect to the server, but can't create room.
Bestlis
Paid Member
 
Posts: 15
Joined: August 6th, 2014, 3:00 pm

Return to Mobile