Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: serverSocket

[290:14] (extern: com.lehman.aussom.AussomServerSocket) extends: object

The serverSocket class implements TCP socket functionality.

Methods

  • serverSocket (int Port = 80)

  • newServerSocket (int Port = 80)

  • bind (string Host = "localhost")

    Binds the socket to the provided address.

    • @p Host is an optional string with the host to use.
    • @r This object.
  • close ()

    Closes the socket connection.

    • @return This object.
  • setReuseAddress (bool ReuseAddress)

    Sets the reuse address flag.

    • @p ReuseAddress is a bool with the reuse address flag.
    • @r This object.
  • setPerformancePreferences (int ConnectionTime, int Latency, int Bandwidth)

    Sets the performance preference values. These maximum values are irrelevant and these are just compared to eachother.

    • @p ConnectionTime is an int with the connection time value.
    • @p Latency is an int with the latency value.
    • @p Bandwidth is an int with the bandwidth value.
    • @r This object.
  • setReceiveBufferSize (int RxBufferSize)

    Sets the receive buffer size.

    • @p RxBufferSize is an int with the receive buffer size.
    • @r This object.
  • setHost (string Host)

    Sets the host for this socket. This must be called prior to connect.

    • @p Host is a string with the host name to set.
    • @r This object.
  • setPort (int Port)

    Sets the port number. This must be called prior to connect.

    • @p Port is an int with the port number to set.
    • @r This object.
  • setSoTimeout (int Timeout)

    Sets the SO_TIMEOUT flag. This must be called prior to connect.

    • @p Timeout is an int with the timeout to set.
    • @r This object.
  • accept ()

    Accepts a new incoming connection and returns the socket. This call blocks until a connection is accepted or an IO exception occurs.

    • @r A socket object with the new connection.
  • getHost ()

    Gets a string with the host name.

    • @r A string with the host name.
  • getPort ()

    Gets the port number.

    • @r An int with the port number.
  • getReuseAddress ()

    Gets the reuse address flag.

    • @r A bool with the reuse flag.
  • isBound ()

    Gets the is bound flag.

    • @r A bool with the is bound flag.
  • isClosed ()

    Gets the is closed flag.

    • @r A bool with the is closed flag.
  • getReceiveBufferSize ()

    Gets the receive buffer size.

    • @r An int with the receive buffer size.
  • getSoTimeout ()

    Gets the SO_TIMEOUT flag. This must be called prior to connect.

    • @r A bool with the flag.

class: trafficClass

[32:6] static extends: object

Enum for Socket traffic classes.

Members

  • lowcost
  • reliability
  • throughput
  • lowdelay

class: socket_module

[23:14] static extends: object

Module JAR loader class.

Methods

  • socket_module ()

class: socket

[42:14] (extern: com.lehman.aussom.AussomSocket) extends: object

The socket class implements TCP socket functionality.

Methods

  • socket (string Host = "", int Port = 80)

    Socket constructor.

    • @p Host is an optional string with the socket hostname.
    • @p Port is an optional int with the port number.
    • @r This object.
  • newSocket (string Host = "", int Port = 80)

  • connect (string Host = "")

    Creates a new socket connection with the provided host name.

    • @p Host is the optional host name to connect to.
    • @r This object.
  • bind (string Host = "localhost")

    Binds the socket to the local address.

    • @p Host is an optional string with the host to bind to.
    • @r This object.
  • close ()

    Closes the socket.

    • @r This object.
  • setKeepAlive (bool KeepAlive)

    Sets the keep alive flag.

    • @p KeepAlive is a bool with the flag value.
    • @r This object.
  • setOOBInline (bool OOBInline)

    Sets the SO_OOBINLINE flag (receipt of TCP urgent data).

    • @p OOBInline is a boolean with the flag value.
    • @r This object.
  • setPerformancePreferences (int ConnectionTime, int Latency, int Bandwidth)

    Sets the performance preference values. These maximum values are irrelevant and these are just compared to eachother.

    • @p ConnectionTime is an int with the connection time value.
    • @p Latency is an int with the latency value.
    • @p Bandwidth is an int with the bandwidth value.
    • @r This object.
  • setReceiveBufferSize (int RxBufferSize)

    Sets the SO_RCVBUF size for the socket.

    • @p RxBufferSize is an int with the buffer size.
    • @r This object.
  • setReuseAddress (bool ReuseAddress)

    Sets the SO_REUSEADDR socket flag.

    • @p ReuseAddress is a boolean with the flag.
    • @r This object.
  • setSendBufferSize (int TxBufferSize)

    Sets the SO_SNDBUF buffer size for this socket.

    • @p TxBufferSize is an int with the buffer size.
    • @r This object.
  • setSoLinger (bool LingerOn, int LingerVal)

    Sets the SO_LINGER value with the specified time in seconds.

    • @p LingerOn is a boolean with the linger flag.
    • @p LingerVal is an int with the value.
    • @r This object.
  • setTcpNoDelay (bool NoDelay)

    Sets the TCP_NODELAY (disable/enable Nagle's algorithm) flag.

    • @p NoDelay is the flag to set.
    • @r This object.
  • setTrafficClass (string TrafficClass)

    Sets the type-of-service octet in the IP header for packets sent from this socket.

    • @p TrafficClass is a string with the traffic class to set. See the trafficClass enum for available values.
    • @r This object.
  • writeln (string Line)

    Writes the provided line to the socket.

    • @p Line is a string to write.
    • @r This object.
  • write (string Str)

    Writes the provided string to the socket.

    • @p Str is the string to write.
    • @r This object.
  • writeBytes (object Buff)

    Writes the bytes with the provided Buffer object to the socket.

    • @p Buff is the Buffer object to write.
    • @r This object.
  • writeBytesFrom (object Buff, int Index = 0, int Length = -1)

    Writes bytes from the provided Buffer with the provided index and length.

    • @p Buff is the Buffer object to write.
    • @p Index is the start index within the Buffer to write.
    • @p Length is the length in bytes to write with the default of -1 meaning write all from the index.
    • @r This object.
  • setHost (string Host)

    Sets the host string. This must be set prior to connect.

    • @p Host is a string with the host to set.
    • @r This object.
  • setPort (int Port)

    Sets the port number. This must be called prior to connect.

    • @p Port is an int with the port number to set.
    • @r This object.
  • setSoTimeout (int Timeout)

    Sets the SO_TIMEOUT with the specified timeout in milliseconds. This must be called prior to connect.

    • @p Timeout is an int with the timeout in milliseconds to set.
    • @r This object.
  • readln ()

    Reads a string of characters from the stream until a newline character is found.

    • @r A string with the characters read.
  • read ()

    Reads a single character from the stream.

    • @r A string with the returned character.
  • readBytes (int Length)

    Reads X number of bytes from the stream into a Buffer that is returned.

    • @p Length is an int with the number of bytes to read.
    • @r A Buffer object with the read bytes.
  • readBytesTo (object Buff, int Index = 0, int Length = -1)

    Reads X number of bytes from the stream into the provided Buffer at the given index.

    • @p Buff is the Buffer object to read bytes into.
    • @p Index is an int with the index to start reading into at.
    • @p Length is an int with the number of bytes to read.
    • @r This object.
  • getKeepAlive ()

    Gets the SO_KEEPALIVE flag value.

    • @r A bool with the keep alive flag.
  • getOOBInline ()

    Gets the SO_OOBINLINE flag.

    • @r A bool with the flag.
  • getReceiveBufferSize ()

    Gets the receive buffer size.

    • @r An int with the receive buffer size.
  • getReuseAddress ()

    Gets the reuse address flag.

    • @r A bool with the reuse address flag.
  • getSendBufferSize ()

    Gets the send buffer size.

    • @r An it with the send buffer size.
  • getSoLinger ()

    Gets the SO_LINGER flag.

    • @r A bool with the flag.
  • getTcpNoDelay ()

    Gets the TCP_NODELAY flag.

    • @r A bool with the flag.
  • getTrafficClass ()

    Gets the traffic class for the socket.

    • @r A string with the traffic class. See the trafficClass enum for available values.
  • getSoTimeout ()

    Gets the SO_TIMEOUT value.

    • @r An int with the timeout value.