Libraries anvil net

namespace net
Provides access to network services.

Classes

class Citizen
extends anvil.lang.object

class Context
extends anvil.lang.object
The Context holds information about the request, response, session, and user.

class Cookie
extends anvil.lang.object
Cookie is a small amount of information sent by server to web browser, saved by browser and later sent back to server when the client accesses the same web page.

class FtpClient
extends anvil.lang.object
Embedded FTP client.

class InetAddress
extends anvil.lang.object
This class represents an Internet Protocol (IP) address.

class Realm
extends anvil.lang.object

class Request
extends anvil.lang.object
The HTTP request from the client terminal/browser.

All request parameters (URL parameters and FORM parameters) appear as request's fields. For example, if the query string contains "a=1&b=2", there will be two fields available in the request: request.a and request.b

If parameter names contains "keys" enclosed into angle brackets corresponding array structures are created onto request. For example:

   <input type="person[name]"  value="john doe">
   <input type="person[age]"  value="50">
   
When submitted will yield to attribute person to request with value ["name"=>"john doe", "age"=>"50"].

Handles also file uploads. For example:

    <form method="post" ENCTYPE="multipart/form-data">
    <input type="file" name="file1">
    </form>
    
Here the request.file1 field will contain a File datatype, which represents an uploaded file.


class Response
extends anvil.lang.object
The HTTP response to the client terminal/browser.

class ServerSocket
extends anvil.lang.object
A server socket waits for requests to come in over the network.

class Session
extends anvil.lang.object
The session datatype is used for representing a unique user session.

class SessionContainer
extends anvil.lang.object

class Socket
extends anvil.lang.object
Client socket (also called just "socket"). A socket is an endpoint for communication between two machines.

class Tribe
extends anvil.lang.object

class URL
extends anvil.lang.object
Uniform Resource Locator. Class URL represents a URL address, a pointer to a "resource" on the World Wide Web.

class URLConnection
extends anvil.lang.object
Represents a communications link between the application and a URL. Instances of this class can be used both to read from and to write to the resource referenced by the URL.


Exceptions

class BindError
extends anvil.net.SocketError

class ConnectError
extends anvil.net.SocketError

class MalformedURL
extends anvil.io.IOError

class NoRouteToHost
extends anvil.net.SocketError

class ProtocolError
extends anvil.io.IOError

class SocketError
extends anvil.io.IOError

class UnknownHost
extends anvil.io.IOError

class UnknownService
extends anvil.io.IOError


Constants

constant ECHO_PORT

constant FINGER_PORT

constant FTP_PORT
Port of FTP service (21).

constant HTTP_PORT

constant HTTPS_PORT

constant IMAP2_PORT

constant IMAP3_PORT

constant IRC_PORT

constant NAMESERVER_PORT

constant NNTP_PORT

constant POP2_PORT

constant POP3_PORT

constant PRINTER_PORT

constant SMTP_PORT
Port of SMTP service (25).

constant SSH_PORT
Port of FTP service (22).

constant TELNET_PORT
Port of Telnet service (23).

constant WHO_PORT

constant WHOIS_PORT


Functions

InetAddress getAllByName(string host)
Returns an array of all addresses of given hostname resolved, or null if resolving failed.

InetAddress getByName(string host)
Returns the address of given hostname resolved, or null if it couldn't be resolved.

InetAddress getLocalHost()
Returns the address of localhost, or null if it couldn't be resolved.