Search Unity

how to connect client to a domain with unity transport

Discussion in 'Unity Transport' started by ElegantUniverse, Nov 3, 2021.

  1. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    hello
    I was faced with a problem when I wanted to define a domain instead of serverIp for the client. I found out we cant use a string of domain same as Ip string and we should use blow code :

    [SOLVED]

    Code (CSharp):
    1.  
    2.    _clientDrive = NetworkDriver.Create(new ReliableUtility.Parameters { WindowSize = 32 });
    3.        _reliablePipline = _clientDrive.CreatePipeline(typeof(ReliableSequencedPipelineStage));
    4.        _unreliablePipline = _clientDrive.CreatePipeline(typeof(UnreliableSequencedPipelineStage));
    5.  
    6.  
    7. IPHostEntry iPHostEntry = Dns.GetHostEntry("yourdomain. com");
    8.        
    9. _serverEndPoint = NetworkEndPoint.Parse(iPHostEntry.AddressList[0].ToString(), _clientPort);




    If this solution helped you please like this message.
     
    peculiarnewbie and Foreman_Dev like this.