Search Unity

Bug Vivox Login issue

Discussion in 'Vivox (Voice & Text Chat)' started by S3iko, Dec 2, 2022.

  1. S3iko

    S3iko

    Joined:
    Sep 5, 2022
    Posts:
    1
    When I press the login button on unity this error shows up
    Also when I tried the vivox sample the same error showed up

    <BeginGetConnectorHandle>b__0: vx_req_connector_create_t failed: VivoxUnity.VivoxApiException: HTTP Connection Reset (10056)
    at VivoxUnity.VxClient.EndIssueRequest (System.IAsyncResult result) [0x00056] in C:\Users\Seiko\Vivox-Test\Library\PackageCache\com.unity.services.vivox@15.1.190000-pre.1\Runtime\VivoxUnity\VxClient.cs:234
    at VivoxUnity.Client+<>c__DisplayClass21_0.<BeginGetConnectorHandle>b__0 (System.IAsyncResult ar) [0x00000] in C:\Users\Seiko\Vivox-Test\Library\PackageCache\com.unity.services.vivox@15.1.190000-pre.1\Runtime\VivoxUnity\Client.cs:112
    UnityEngine.Debug:LogError (object)
    VivoxUnity.VivoxDebug:DebugMessage (object,vx_log_level) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/VivoxDebug.cs:87)
    VivoxUnity.VivoxDebug:VxExceptionMessage (string) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/VivoxDebug.cs:45)
    VivoxUnity.Client/<>c__DisplayClass21_0:<BeginGetConnectorHandle>b__0 (System.IAsyncResult) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/Client.cs:116)
    VivoxUnity.AsyncResult`1<vx_resp_base_t>:SetComplete (vx_resp_base_t) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/AsyncResult.cs:120)
    VivoxUnity.VxClient:InstanceOnMainLoopRun (bool&) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/VxClient.cs:167)
    MessagePump:RunOnce () (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/MessagePump.cs:73)
    MessagePump:RunUntil (LoopDone) (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/MessagePump.cs:56)
    VivoxUnity.Client:RunOnce () (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/Client.cs:298)
    VivoxUnity.VxUnityInterop/<VivoxUnityRun>d__6:MoveNext () (at Library/PackageCache/com.unity.services.vivox@15.1.190000-pre.1/Runtime/VivoxUnity/VxUnityInterop.cs:66)
    UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)





    LoginCredential.cs

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using VivoxUnity;
    using System.ComponentModel;
    using System;

    public class LoginCredential : MonoBehaviour



    {
    VivoxUnity.Client client;
    private Uri server = new Uri("");
    private string issuer = "";
    private string domain = "";
    private string tokenKey = "";
    private TimeSpan timeSpan = new TimeSpan(90);


    private ILoginSession loginSession;


    private void Awake()
    {
    client = new Client();
    client.Uninitialize();
    client.Initialize();
    DontDestroyOnLoad(this);
    }

    private void OnApplicationQuit()
    {
    client.Uninitialize();

    }
    // Start is called before the first frame update
    void Start()
    {

    }

    public void Bind_Login_Callback_Listeners(bool bind, ILoginSession loginSesh)
    {
    if (bind)
    {
    loginSesh.PropertyChanged += Login_Status;

    }
    else
    {
    loginSesh.PropertyChanged -= Login_Status;
    }

    }

    public void LoginUser()
    {
    Login("TestName");
    }

    public void Login(string userName)
    {
    AccountId accountId = new AccountId(issuer, userName, domain);
    loginSession = client.GetLoginSession(accountId);
    Bind_Login_Callback_Listeners(true, loginSession);
    loginSession.BeginLogin(server, loginSession.GetLoginToken(tokenKey, timeSpan), ar =>
    {

    try
    {
    loginSession.EndLogin(ar);
    }
    catch (Exception e)
    {
    Bind_Login_Callback_Listeners(false, loginSession);
    Debug.Log(e.Message);
    }
    // run more code here

    });
    }



    public void Logout()
    {

    loginSession.Logout();
    Bind_Login_Callback_Listeners(false, loginSession);

    }

    public void Login_Status(object sender, PropertyChangedEventArgs loginArgs)
    {

    var source = (ILoginSession)sender;

    switch (source.State)
    {
    case LoginState.LoggingIn:
    Debug.Log("Logging In");
    break;

    case LoginState.LoggedIn:
    Debug.Log($"Logged In {loginSession.LoginSessionId.Name}");
    break;
    }
    }





    }
     

    Attached Files:

  2. MurphyMurph_21

    MurphyMurph_21

    Joined:
    Jul 3, 2020
    Posts:
    73
    You have to use TimeSpan.FromSeconds(90);
     
  3. MaroLFC

    MaroLFC

    Joined:
    Aug 6, 2017
    Posts:
    6
    I did change
    timaspan = TimeSpan.FromSeconds(90);
    but the error persists and i can't seem to find a solution
     
  4. MurphyMurph_21

    MurphyMurph_21

    Joined:
    Jul 3, 2020
    Posts:
    73
    @MaroLFC According to the Vivox Documentation here your error code has something to do with the network. It recommeneds retrying the login request with a backoff, so try to login, if it fails wait 1 second, if it fails again, wait 2 seconds and try again and so on.

    Considering its a networking error i recommended checking if any of the following are true. DO you have Antivirus on your computer running in the background. Also are logging in from work or home wifi network? Are you using a VPN? Are you using a Mobile HotSpot to connect to Vivox. Do you live in Pakistan or another country with strict internet access.?
     
  5. MaroLFC

    MaroLFC

    Joined:
    Aug 6, 2017
    Posts:
    6
    I live in Egypt so i suspect Vivox maybe blocked in here although games like fortnite which i think use Vivox works fine here. I will try your suggestion and see where it gets me
     
  6. MohamedBadawy

    MohamedBadawy

    Joined:
    Jan 10, 2021
    Posts:
    1
    should using a VPN in Egypt , cause Your ports are blocked by your Internet service providers.