/// <summary> /// A constructor to specify the target IPEndPoint. /// Use this constructor for a listening socket or a connecting socket. /// </summary> /// <param name="targetIPEndPoint">The target IPEndPoint to listen for or to connect to.</param> public NetworkSocketManagerTCP(IPEndPoint targetIPEndPoint) { skt = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socketEndPointsLink = new EndPointsLink( (IPEndPoint)skt.LocalEndPoint, targetIPEndPoint); listenMode = false; }
/// <summary> /// A constructor to attach a socket. /// Use this constructor when accepting sockets. /// </summary> /// <param name="sktTarget">The socket to attach.</param> public NetworkSocketManagerTCP(Socket sktTarget) { skt = sktTarget; socketEndPointsLink = new EndPointsLink( (IPEndPoint)skt.LocalEndPoint, (IPEndPoint)skt.RemoteEndPoint); listenMode = false; }
/// <summary> /// General constructor to be used when no prior information is availble for the socket. /// </summary> public NetworkSocketManagerTCP() { skt = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socketEndPointsLink = new EndPointsLink( (IPEndPoint)skt.LocalEndPoint, new IPEndPoint(IPAddress.None,0)); }