Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Can Transport be used on the client, to connect with a generic TCP socket server?

Discussion in 'Unity Transport' started by teeth2i4, Jan 11, 2022.

  1. teeth2i4

    teeth2i4

    Joined:
    May 21, 2013
    Posts:
    9
    I'm looking for a client-side TCP socket solution, that's a bit higher-level than C#'s System.Net.Sockets.
    On the server side I expect some generic TCP socket support.
    Here https://docs.unity3d.com/Manual/UNetUsingTransport.html it says that Transport uses "UDP for generic communications, and WebSockets for WebGL". Does it mean I can't use TCP?

    Tried Websockets, https://github.com/sta/websocket-sharp, but they turned out to be kinda buggy and not in active development.
     
    cmdexecutor and Cornwine like this.
  2. cmdexecutor

    cmdexecutor

    Joined:
    Sep 30, 2014
    Posts:
    15
    was also interested in using the library with the TCP server we already have, looks like there's no use atm.
    This lib utilizes it's own protocol on top of UDP and we can not change it nor extend cause everything's internal and private. We love the lib, it's well built and looks robust but the luck of TCP/raw data support is frustrating.
    Any plans on the roadmap?
     
  3. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    231
    Are you referring to the same library as the OP? They're linking to UNet which is deprecated and now actually removed from Unity altogether in recent versions.

    If you're referring to the Unity Transport library (the com.unity.transport package), then unfortunately we have no plans to support using it for raw TCP or UDP access. For that purpose we recommend using .NET sockets.