Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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.