Version: 2017.1
public static int ConnectEndPoint (int hostId, EndPoint endPoint, int exceptionConnectionId, out byte error);

参数

hostId 与此连接关联的主机 ID(在调用 NetworkTransport.AddHost 时检索)。
error 错误(可以转换为 NetworkError 以便了解更多信息)。
xboxOneEndPoint 一个有效的 System.EndPoint。
exceptionConnectionId 如果是默认连接,则设置为 0。

返回

int 成功时的唯一连接标识符(否则为零)。

描述

尝试建立与其他对等方的连接,该对等方使用 C# System.EndPoint 指定。

这主要适用于需要传入代表远程主机的特殊结构(与常规的 IP/端口组合相比)的平台(例如 Xbox One)。

这还适用于需要使用 IPEndPoint 对象的库。