docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Connect

    Connect(NetworkEndpoint)

    Establish a new connection to the given endpoint. Note that this only starts establishing the new connection. From there it will either succeeds (a Connect event will pop on the connection) or fail (a Disconnect event will pop on the connection) at a later time.

    Declaration
    public NetworkConnection Connect(NetworkEndpoint endpoint)
    Parameters
    Type Name Description
    NetworkEndpoint endpoint

    Endpoint to connect to.

    Returns
    Type Description
    NetworkConnection

    New connection object, or a default-valued object on failure.

    Remarks

    Establishing a new connection normally requires the driver to be bound (e.g. with the Bind(NetworkEndpoint) method), but if that's not the case when calling this method, the driver will be implicitly bound to the appropriate wildcard address. This is a behavior similar to BSD sockets, where calling connect automatically binds the socket to an ephemeral port.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023