// public int Connect(string address, int port) { int node = -1; // 도달 보증용 TCP 통신을 시작합니다. node = m_sessionTcp.Connect(address, port); return(node); }
/* * +-------------------------+ * | Connection | * +-------------------------+ */ public int Connect(string address, int port, ConnectionType type) { int node = -1; if (type == ConnectionType.TCP) { node = sessionTcp?.Connect(address, port) ?? -1; } if (type == ConnectionType.UDP) { node = sessionUdp?.Connect(address, port) ?? -1; } return(node); }
// public int Connect(string address, int port, ConnectionType type) { int node = -1; if (type == ConnectionType.Reliable && m_sessionTcp != null) { // 도달 보장을 위한 TCP 통신을 시작. node = m_sessionTcp.Connect(address, port); } if (type == ConnectionType.Unreliable && m_sessionUdp != null) { // 도달 보장을 하지 않는 UDP 통신을 시작. node = m_sessionUdp.Connect(address, port); } return(node); }