public NetworkNode(IPAddress address, RFCProtocol protocol = RFCProtocol.Unknown, ushort port = 0, Socket socket = null) { Address = address; Protocol = protocol; Port = port; Socket = socket; }
/// <summary> /// Create a new server instance bound to a specific IP address for the local host /// </summary> /// <param name="IPAddress">IP Address to bind server to, must be an IP address on a currently-connected interface</param> /// <param name="Port">Port to use for server, default: 23 (Telnet)</param> /// <param name="Protocol">Protocol to use for the server, default: Telnet (RFC854)</param> public LineBasedTCPServer(IPAddress IPAddress, UInt16 Port = (UInt16)DefaultPorts.Telnet, RFCProtocol Protocol = RFCProtocol.Telnet) : base(IPAddress, Port, Protocol) { }
/// <summary> /// Create a new server instance bound to the first found IP address for the local host /// </summary> /// <param name="Port">Port to use for server, default: 23 (Telnet)</param> /// <param name="Protocol">Protocol to use for the server, default: Telnet (RFC854)</param> public LineBasedTCPServer(UInt16 Port = (UInt16)DefaultPorts.Telnet, RFCProtocol Protocol = RFCProtocol.Telnet) : base(IPAddressExtensions.LocalIPAddress(), Port, Protocol) { }
/// <summary> /// Creates a new socket for this client and assigns it to the Socket property. /// This function may be called by dervied constructors. Derived instances should call the base function before creating the socket. /// </summary> /// <param name="Port">Local port number to listen for connections</param> /// <param name="Protocol">Protocol to be used by this server</param> public virtual void CreateClient(UInt16 port, RFCProtocol protocol) { this.Port = port; this.Protocol = protocol; }
/// <summary> /// Creates a new socket for this server and assigns it to the Socket property. /// This function may be called by dervied constructors. Derived instances should call the base function before creating the socket. /// </summary> /// <param name="Address">Local IP Address to bind the server to</param> /// <param name="Port">Local port number to listen for connections</param> /// <param name="Protocol">Protocol to be used by this server</param> public virtual void CreateServer(IPAddress Address, UInt16 Port, RFCProtocol Protocol) { this.Address = Address; this.Port = Port; this.Protocol = Protocol; }
public override void CreateClient(UInt16 port, RFCProtocol protocol) { base.CreateClient(port, protocol); this.Socket = new Socket(SocketType.Stream, ProtocolType.Tcp); }
/// <summary> /// Create a new client instance /// </summary> /// <param name="Port">Port to use for server, default: 23 (Telnet)</param> /// <param name="Protocol">Protocol to use for the server, default: Telnet (RFC854)</param> public LineBasedTCPClient(UInt16 Port = (UInt16)DefaultPorts.Telnet, RFCProtocol Protocol = RFCProtocol.Telnet) : base(Port, Protocol) { }
/// <summary> /// Create a new TCP client instance /// </summary> /// <param name="port">Local port number to listen for connections</param> /// <param name="protocol">Protocol to be used by this server</param> public TCPClient(UInt16 port = (UInt16)DefaultPorts.Telnet, RFCProtocol protocol = RFCProtocol.TCP) : base(new P(), port, protocol) { }
public override void CreateServer(IPAddress address, UInt16 port, RFCProtocol protocol) { base.CreateServer(address, port, protocol); this.Socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp); }
/// <summary> /// Create a new TCP server instance bound to a specific IP address for the local host /// </summary> /// <param name="address">IP Address to bind server to, must be an IP address on a currently-connected interface</param> /// <param name="port">Port to use for server, default: 23 (Telnet)</param> /// <param name="protocol">Protocol to use for the server, default: TCP (RFC793)</param> public TCPServer(IPAddress address, UInt16 port = (UInt16)DefaultPorts.Telnet, RFCProtocol protocol = RFCProtocol.TCP) : base(new P(), address, port, protocol) { }
/// <summary> /// Create a new client instance /// </summary> /// <param name="BufferType">Instance to indicate the buffer type</param> /// <param name="Port">Local port number to listen for connections</param> /// <param name="Protocol">Protocol to be used by this server</param> public BufferedInternetClient(T BufferType, UInt16 Port = (UInt16)DefaultPorts.Telnet, RFCProtocol Protocol = RFCProtocol.TCP) : base() { PacketType = BufferType; InitBuffer(); CreateClient(Port, Protocol); }
/// <summary> /// Create a new TCP server instance bound to a specific IP address for the local host /// </summary> /// <param name="BufferType">Instance to indicate the buffer type</param> /// <param name="IPAddress">IP Address to bind server to, must be an IP address on a currently-connected interface</param> /// <param name="Port">Port to use for server, default: 23 (Telnet)</param> /// <param name="Protocol">Protocol to use for the server, default: TCP (RFC793)</param> public BufferedInternetServer(T BufferType, IPAddress IPAddress, UInt16 Port = (UInt16)DefaultPorts.Telnet, RFCProtocol Protocol = RFCProtocol.TCP) : base() { PacketType = BufferType; InitBuffer(); CreateServer(IPAddress, Port, Protocol); }