head 1.1; branch 1.1.1; access ; symbols DEVEL:1.1.1.1 HEAD:1.1.1; locks ; strict; comment @# @; 1.1 date 2001.03.16.18.13.10; author jallali; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.03.16.18.13.10; author jallali; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.net
Class Socket

    java.lang.Object
      |
      +--java.net.Socket

public class Socket
extends Object

Constructor Summary
`protected` | `Socket()` Construct a connection-oriented Socket.
`` | `Socket(InetAddress dstAddress, int dstPort)` Construct a stream socket connected to the nominated destination host address/port.
`` | `Socket(InetAddress dstAddress, int dstPort, InetAddress localAddress, int localPort)` Construct a stream socket connected to the nominated destination host address/port.
`protected` | `Socket(SocketImpl anImpl)` Creates an unconnected socket, wrapping the `socketImpl` argument.
`` | `Socket(String dstName, int dstPort)` Construct a stream socket connected to the nominated destination host/port.
`` | `Socket(String dstName, int dstPort, InetAddress localAddress, int localPort)` Construct a stream socket connected to the nominated destination host/port.

Method Summary
`void` | `close()` Close the socket.
`InetAddress` | `getInetAddress()` Answer the remote address to which the socket is connected.
`InputStream` | `getInputStream()` Answer the socket input stream, to read byte data off the socket.
`InetAddress` | `getLocalAddress()` Answer the local address to which the socket is bound.
`int` | `getLocalPort()` Answer the local port to which the socket is bound.
`OutputStream` | `getOutputStream()` Answer the socket output stream, for writing byte data on the socket.
`int` | `getPort()` Answer the remote port to which the socket is connected
`int` | `getReceiveBufferSize()` Answer the socket receive buffer size (SO_RCVBUF).
`int` | `getSendBufferSize()` Answer the socket send buffer size (SO_SNDBUF).
`int` | `getSoLinger()` Answer the linger-on-close timeout for this socket.
`int` | `getSoTimeout()` Answer the socket read timeout.
`boolean` | `getTcpNoDelay()` Answer true if the socket is using Nagle's algorithm.
`void` | `setReceiveBufferSize(int size)` Set the socket receive buffer size.
`void` | `setSendBufferSize(int size)` Set the socket send buffer size.
`void` | `setSoLinger(boolean on, int timeout)` Set the SO_LINGER option, with the specified time, in milliseconds.
`void` | `setSoTimeout(int timeout)` Set the read timeout on this socket.
`void` | `setTcpNoDelay(boolean on)` Set whether the socket is to use Nagle's algorithm.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Socket

    protected Socket()

  Construct a connection-oriented Socket. The Socket is created in the `factory` if declared, or otherwise of the default type.
  See Also:
    `SocketImplFactory`

### Socket

    public Socket(String dstName,
                  int dstPort)
           throws UnknownHostException,
                  IOException

  Construct a stream socket connected to the nominated destination host/port. By default, the socket binds it to any available port on the default localhost.
  Parameters:
    `dstName` - the destination host to connect to
    `dstPort` - the port on the destination host to connect to
  Throws:
    UnknownHostException - if the host cannot be resolved
    IOException - if an error occurs while instantiating the socket

### Socket

    public Socket(String dstName,
                  int dstPort,
                  InetAddress localAddress,
                  int localPort)
           throws IOException

  Construct a stream socket connected to the nominated destination host/port. The socket is bound it to the nominated localAddress/port.
  Parameters:
    `dstName` - the destination host to connect to
    `dstPort` - the port on the destination host to connect to
    `localAddress` - the local host address to bind to
    `localPort` - the local port to bind to
  Throws:
    UnknownHostException - if the host cannot be resolved
    IOException - if an error occurs while instantiating the socket

### Socket

    public Socket(InetAddress dstAddress,
                  int dstPort)
           throws IOException

  Construct a stream socket connected to the nominated destination host address/port. By default, the socket binds it to any available port on the default localhost.
  Parameters:
    `dstAddress` - the destination host address to connect to
    `dstPort` - the port on the destination host to connect to
  Throws:
    IOException - if an error occurs while instantiating the socket

### Socket

    public Socket(InetAddress dstAddress,
                  int dstPort,
                  InetAddress localAddress,
                  int localPort)
           throws IOException

  Construct a stream socket connected to the nominated destination host address/port. The socket is bound it to the nominated localAddress/port.
  Parameters:
    `dstAddress` - the destination host address to connect to
    `dstPort` - the port on the destination host to connect to
    `localAddress` - the local host address to bind to
    `localPort` - the local port to bind to
  Throws:
    IOException - if an error occurs while instantiating the socket

### Socket

    protected Socket(SocketImpl anImpl)
              throws SocketException

  Creates an unconnected socket, wrapping the `socketImpl` argument.
  Parameters:
    `anImpl` - the socket to wrap
  Throws:
    SocketException - thrown if an error occurs assigning the implementation

Method Detail

### close

    public void close()
               throws IOException

  Close the socket. It is not valid to use the socket thereafter.
  Throws:
    IOException - if an error occurs during the close

### getInetAddress

    public InetAddress getInetAddress()

  Answer the remote address to which the socket is connected.
  Returns:
    InetAddress the remote address to which the socket is connected

### getInputStream

    public InputStream getInputStream()
                               throws IOException

  Answer the socket input stream, to read byte data off the socket. Note, multiple input streams may be created on a single socket.
  Returns:
    InputStream a byte oriented read stream for this socket
  Throws:
    IOException - if an error occurs creating the stream
  See Also:
    `SocketInputStream`

### getLocalAddress

    public InetAddress getLocalAddress()

  Answer the local address to which the socket is bound.
  Returns:
    InetAddress the local address to which the socket is bound

### getLocalPort

    public int getLocalPort()

  Answer the local port to which the socket is bound.
  Returns:
    int the local port to which the socket is bound

### getOutputStream

    public OutputStream getOutputStream()
                                 throws IOException

  Answer the socket output stream, for writing byte data on the socket. Note, multiplie output streams may be created on a single socket.
  Returns:
    OutputStream a byte oriented write stream for this socket
  Throws:
    IOException - if an error occurs creating the stream
  See Also:
    `SocketOutputStream`

### getPort

    public int getPort()

  Answer the remote port to which the socket is connected
  Returns:
    int the remote port to which the socket is connected.

### getSoLinger

    public int getSoLinger()
                    throws SocketException

  Answer the linger-on-close timeout for this socket. The SO_LINGER option, a value of -1 indicates it is disabled.
  Returns:
    int the linger-on-close timeout for this socket
  Throws:
    SocketException - thrown if an error occurs on the option access

### getReceiveBufferSize

    public int getReceiveBufferSize()
                             throws SocketException

  Answer the socket receive buffer size (SO_RCVBUF).
  Returns:
    int socket receive buffer size

### getSendBufferSize

    public int getSendBufferSize()
                          throws SocketException

  Answer the socket send buffer size (SO_SNDBUF).
  Returns:
    int socket send buffer size

### getSoTimeout

    public int getSoTimeout()
                     throws SocketException

  Answer the socket read timeout. The SO_TIMEOUT option, a value of 0 indicates it is disabled and a read operation will block indefinitely waiting for data.
  Returns:
    int the socket read timeout
  Throws:
    SocketException - thrown if an error occurs on the option access

### getTcpNoDelay

    public boolean getTcpNoDelay()
                          throws SocketException

  Answer true if the socket is using Nagle's algorithm. The TCP_NODELAY option setting.
  Returns:
    boolean the socket TCP_NODELAY option setting
  Throws:
    SocketException - thrown if an error occurs on the option access

### setSendBufferSize

    public void setSendBufferSize(int size)
                           throws SocketException

  Set the socket send buffer size.
  Parameters:
    `size` - the buffer size, in bytes
  Throws:
    SocketException - If an error occurs while setting the size or the size is invalid.

### setReceiveBufferSize

    public void setReceiveBufferSize(int size)
                              throws SocketException

  Set the socket receive buffer size.
  Parameters:
    `size` - the buffer size, in bytes
  Throws:
    SocketException - If an error occurs while setting the size or the size is invalid.

### setSoLinger

    public void setSoLinger(boolean on,
                            int timeout)
                     throws SocketException

  Set the SO_LINGER option, with the specified time, in milliseconds. For values 0< val <=1000 milliseconds, a 1 second linger will be set. The SO_LINGER option is silently limited to 65535 milliseconds.
  Parameters:
    `on` - if linger is enabled
    `timeout` - the linger timeout value, in milliseconds
  Throws:
    SocketException - thrown if an error occurs setting the option

### setSoTimeout

    public void setSoTimeout(int timeout)
                      throws SocketException

  Set the read timeout on this socket. The SO_TIMEOUT option, is specified in milliseconds. The read operation will block indefinitely for a zero value.
  Parameters:
    `timeout` - the read timeout value
  Throws:
    SocketException - thrown if an error occurs setting the option

### setTcpNoDelay

    public void setTcpNoDelay(boolean on)
                       throws SocketException

  Set whether the socket is to use Nagle's algorithm. The TCP_NODELAY option setting.
  Parameters:
    `boolean` - the socket TCP_NODELAY option setting
  Throws:
    SocketException - thrown if an error occurs setting the option

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

@ 1.1.1.1 log @import initial @ text @@