/// <summary> /// Default constructor /// </summary> /// <param name="client">client</param> /// <param name="server">managing server</param> public IocpTcpSocket(TcpClient client, INetworkServer server) : base() { m_client = client; m_server = server; NoDelay = server.NoDelay; IPEndPoint remoteIpEndPoint = m_client.Client.RemoteEndPoint as IPEndPoint; IPEndPoint localIpEndPoint = m_client.Client.LocalEndPoint as IPEndPoint; if (remoteIpEndPoint != null) { String socketHostName = remoteIpEndPoint.Address.ToString(); m_ipInfo = new IPInfo(socketHostName, remoteIpEndPoint, IPEndPointType.REMOTE); } else if (localIpEndPoint != null) { String socketHostName = localIpEndPoint.Address.ToString(); m_ipInfo = new IPInfo(socketHostName, localIpEndPoint, IPEndPointType.LOCAL); } }
/// <summary> /// Accept callback /// </summary> /// <param name="server">server</param> /// <param name="ipInfo">connection info</param> /// <returns>the socket callback interface</returns> public bool OnAccept(IParallelServer server, IPInfo ipInfo, int streamCount) { return true; }
public bool OnAccept(INetworkServer server, IPInfo ipInfo) { return true; }
/// <summary> /// Default constructor /// </summary> /// <param name="client">client</param> /// <param name="server">managing server</param> public IocpTcpSocket(TcpClient client, INetworkServer server):base() { m_client=client; m_server = server; NoDelay = server.NoDelay; IPEndPoint remoteIpEndPoint = m_client.Client.RemoteEndPoint as IPEndPoint; IPEndPoint localIpEndPoint = m_client.Client.LocalEndPoint as IPEndPoint; if (remoteIpEndPoint != null) { String socketHostName = remoteIpEndPoint.Address.ToString(); m_ipInfo = new IPInfo(socketHostName, remoteIpEndPoint, IPEndPointType.REMOTE); } else if (localIpEndPoint != null) { String socketHostName = localIpEndPoint.Address.ToString(); m_ipInfo = new IPInfo(socketHostName, localIpEndPoint, IPEndPointType.LOCAL); } }
/// <summary> /// Accept callback /// </summary> /// <param name="server">server</param> /// <param name="ipInfo">connection info</param> /// <returns>the socket callback interface</returns> public INetworkSocketCallback OnAccept(INetworkServer server, IPInfo ipInfo) { return this; }
/// <summary> /// Accept callback /// </summary> /// <param name="server">server</param> /// <param name="ipInfo">connection info</param> /// <returns>the socket callback interface</returns> public IParallelSocketCallback OnAccept(IParallelServer server, IPInfo ipInfo) { return this; }