namespace TCP

TCP contains the tcp/ip specific functions and classes.

namespace contents
Classes
class Stream - Provides a tcp stream implementation of the standard stream object
Functions
function bind(string,number,number) - Create a socket bound to a TCP port
function connect(string,number,number) - Connect to a host on a specified host and port

Functions

function bind Click to go up to the list
Create a socket bound to a TCP port
Declaration:
    function bind(string host, number port, number af)
Description:
This function attempts to create a TCP socket bound to the specified address and port, and if it succeeds, returns a Network.TCPStream object. The address to bind to can be Network.ANY4 to bind to every IPV4 address or Network.ANY6 to bind to every IPV6 address. If the address family is Network.AF_IPV4, bind will look for an IPV4 address with that name and fail if it doesn't find one. If it is Network.AF_IPV6, it will look for an IPV6 address and fail if it doesn't find one. If it is Network.AF_AUTO, it will try to find an IPV6 address, then try to find an IPV4 address, and only fail if it doesn't find either. Note: you can leave off the af parameter if you wish, and it will default to Network.AF_AUTO.
Parameters:
    Parameter #1: string host - The address to bind to
    Parameter #2: number port - The port to listen on, use 0 for any port
    Parameter #3: number af - The address family to use
Returns:
    An object that can accept connections, or null on error.

function connect Click to go up to the list
Connect to a host on a specified host and port
Declaration:
    function connect(string host, number port, number af)
Description:
This function attempts to create a TCP socket connected to the specified remote address and port, and if it succeeds, returns a Network.TCP.Stream object. If the address family is Network.AF_IPV4, connect will look for an IPV4 address with that name and fail if it doesn't find one. If it is Network.AF_IPV6, it will look for an IPV6 address and fail if it doesn't find one. If it is Network.AF_AUTO, it will try to find an IPV6 address, then try to find an IPV4 address, and only fail if it doesn't find either. Note: you can leave off the af parameter if you wish, and it will default to Network.AF_AUTO.
Parameters:
    Parameter #1: string host - The host to connect to
    Parameter #2: number port - The port to connect to
    Parameter #3: number af - The address family to use
Returns:
    An object connected to the host, or null on failure

Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.