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 SocketImpl

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

public abstract class SocketImpl
extends Object
implements SocketOptions

Field Summary
`protected InetAddress` | `address`
`protected FileDescriptor` | `fd`
`protected int` | `localport`
`protected int` | `port`

Fields inherited from interface java.net.SocketOptions
`IP_MULTICAST_IF, SO_BINDADDR, SO_LINGER, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY`

Constructor Summary
`SocketImpl()` Construct a connection-oriented SocketImpl.

Method Summary
`protected abstract void` | `accept(SocketImpl newSocket)` Accepts a connection on the provided socket.
`protected abstract int` | `available()` Answer the number of bytes that may be read from this socket without blocking.
`protected abstract void` | `bind(InetAddress address, int port)` Binds this socket to the specified local host/port.
`protected abstract void` | `close()` Close the socket.
`protected abstract void` | `connect(InetAddress address, int port)` Connects this socket to the specified remote host address/port.
`protected abstract void` | `connect(String host, int port)` Connects this socket to the specified remote host/port.
`protected abstract void` | `create(boolean streaming)` Creates a new unconnected socket.
`protected FileDescriptor` | `getFileDescriptor()` Answer the socket's file descriptor.
`protected InetAddress` | `getInetAddress()` Answer the socket's address.
`protected abstract InputStream` | `getInputStream()` Answer the socket input stream.
`protected int` | `getLocalPort()` Answer the socket's localport.
`abstract Object` | `getOption(int optID)` Answer the nominated socket option.
`protected abstract OutputStream` | `getOutputStream()` Answer the socket output stream.
`protected int` | `getPort()` Answer the socket's remote port.
`protected abstract void` | `listen(int backlog)` Listen for connection requests on this stream socket.
`abstract void` | `setOption(int optID, Object val)` Set the nominated socket option.

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

Field Detail

### address

    protected InetAddress address

### port

    protected int port

### fd

    protected FileDescriptor fd

### localport

    protected int localport

Constructor Detail

### SocketImpl

    public SocketImpl()

  Construct a connection-oriented SocketImpl.
  See Also:
    `SocketImplFactory`

Method Detail

### accept

    protected abstract void accept(SocketImpl newSocket)
                            throws IOException

  Accepts a connection on the provided socket.
  Parameters:
    `newSocket` - the socket to accept connections on
  Throws:
    SocketException - if an error occurs while accepting

### available

    protected abstract int available()
                              throws IOException

  Answer the number of bytes that may be read from this socket without blocking. This call does not block.
  Returns:
    int the number of bytes that may be read without blocking
  Throws:
    SocketException - if an error occurs while peeking

### bind

    protected abstract void bind(InetAddress address,
                                 int port)
                          throws IOException

  Binds this socket to the specified local host/port.
  Parameters:
    `address` - the local machine address to bind the socket to
    `port` - the port on the local machine to bind the socket to
  Throws:
    IOException - if an error occurs while binding

### close

    protected abstract void close()
                           throws IOException

  Close the socket. Usage thereafter is invalid.
  Throws:
    IOException - if an error occurs while closing

### connect

    protected abstract void connect(String host,
                                    int port)
                             throws IOException

  Connects this socket to the specified remote host/port.
  Parameters:
    `host` - the remote host to connect to
    `port` - the remote port to connect to
  Throws:
    IOException - if an error occurs while connecting

### connect

    protected abstract void connect(InetAddress address,
                                    int port)
                             throws IOException

  Connects this socket to the specified remote host address/port.
  Parameters:
    `address` - the remote host address to connect to
    `port` - the remote port to connect to
  Throws:
    IOException - if an error occurs while connecting

### create

    protected abstract void create(boolean streaming)
                            throws IOException

  Creates a new unconnected socket. If streaming is true, create a stream socket, else a datagram socket.
  Parameters:
    `streaming` - true, if the socket is type streaming
  Throws:
    SocketException - if an error occurs while creating the socket

### getFileDescriptor

    protected FileDescriptor getFileDescriptor()

  Answer the socket's file descriptor.
  Returns:
    FileDescriptor the socket FileDescriptor

### getInetAddress

    protected InetAddress getInetAddress()

  Answer the socket's address. Refering to the class comment: Listener: The local machines IP address to which this socket is bound. Host: The client machine, to which this socket is connected. Client: The host machine, to which this socket is connected.
  Returns:
    InetAddress the socket address

### getInputStream

    protected abstract InputStream getInputStream()
                                           throws IOException

  Answer the socket input stream.
  Returns:
    InputStream an InputStream on the socket
  Throws:
    IOException - thrown if an error occurs while accessing the stream

### getLocalPort

    protected int getLocalPort()

  Answer the socket's localport. The field is initialized to -1 and upon demand will go to the IP stack to get the bound value. See the class comment for the context of the local port.
  Returns:
    int the socket localport

### getOption

    public abstract Object getOption(int optID)
                              throws SocketException

  Answer the nominated socket option.
  Specified by:
    getOption in interface SocketOptions
  Parameters:
    `optID` - the socket option to retrieve
  Returns:
    Object the option value
  Throws:
    IOException - thrown if an error occurs while accessing the option

### getOutputStream

    protected abstract OutputStream getOutputStream()
                                             throws IOException

  Answer the socket output stream.
  Returns:
    OutputStream an OutputStream on the socket
  Throws:
    IOException - thrown if an error occurs while accessing the stream

### getPort

    protected int getPort()

  Answer the socket's remote port. This value is not meaningful when the socketImpl is wrapped by a ServerSocket.
  Returns:
    int the remote port the socket is connected to

### listen

    protected abstract void listen(int backlog)
                            throws IOException

  Listen for connection requests on this stream socket. Incoming connection requests are queued, up to the limit nominated by backlog. Additional requests are rejected. listen() may only be invoked on stream sockets.
  Parameters:
    `backlog` - the max number of outstanding connection requests
  Throws:
    IOException - thrown if an error occurs while listening

### setOption

    public abstract void setOption(int optID,
                                   Object val)
                            throws SocketException

  Set the nominated socket option.
  Specified by:
    setOption in interface SocketOptions
  Parameters:
    `optID` - the socket option to set
    `val` - the option value
  Throws:
    IOException - thrown if an error occurs while 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 @@