Class java.net.SocketImpl
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.net.SocketImpl

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

public class SocketImpl
extends Object
This is the Socket implementation class. It is an abstract class that must be subclassed to provide an actual implementation.

Variable Index

 o address
The internet address where the socket will make connection.
 o fd
The file descriptor object
 o localport
 o port
The port where the socket will make connection.

Constructor Index

 o SocketImpl()

Method Index

 o accept(SocketImpl)
Accepts a connection.
 o available()
Returns the number of bytes that can be read without blocking.
 o bind(InetAddress, int)
Binds the socket to the specified port on the specified host.
 o close()
Closes the socket.
 o connect(String, int)
Connects the socket to the specified port on the specified host.
 o connect(InetAddress, int)
Connects the socket to the specified address on the specified port.
 o create(boolean)
Creates a socket with a boolean that specifies whether this is a stream socket or a datagram socket.
 o getFileDescriptor()
 o getInetAddress()
 o getInputStream()
Gets an InputStream for this socket.
 o getLocalPort()
 o getOutputStream()
Gets an OutputStream for this socket.
 o getPort()
 o listen(int)
Listens for connections over a specified amount of time.
 o toString()
Returns the address and port of this Socket as a String.

Variables

 o fd
  protected FileDescriptor fd
The file descriptor object
 o address
  protected InetAddress address
The internet address where the socket will make connection.
 o port
  protected int port
The port where the socket will make connection.
 o localport
  protected int localport

Constructors

 o SocketImpl
  public SocketImpl()

Methods

 o create
  protected abstract void create(boolean stream) throws IOException
Creates a socket with a boolean that specifies whether this is a stream socket or a datagram socket.
Parameters:
stream - a boolean indicating whether this is a stream or datagram socket
 o connect
  protected abstract void connect(String host,
                                  int port) throws IOException
Connects the socket to the specified port on the specified host.
Parameters:
host - the specified host of the connection
port - the port where the connection is made
 o connect
  protected abstract void connect(InetAddress address,
                                  int port) throws IOException
Connects the socket to the specified address on the specified port.
Parameters:
address - the specified address of the connection
port - the specified port where connection is made
 o bind
  protected abstract void bind(InetAddress host,
                               int port) throws IOException
Binds the socket to the specified port on the specified host.
Parameters:
host - the host
port - the port
 o listen
  protected abstract void listen(int count) throws IOException
Listens for connections over a specified amount of time.
Parameters:
count - the amount of time this socket will listen for connections
 o accept
  protected abstract void accept(SocketImpl s) throws IOException
Accepts a connection.
Parameters:
s - the accepted connection
 o getInputStream
  protected abstract InputStream getInputStream() throws IOException
Gets an InputStream for this socket.
 o getOutputStream
  protected abstract OutputStream getOutputStream() throws IOException
Gets an OutputStream for this socket.
 o available
  protected abstract int available() throws IOException
Returns the number of bytes that can be read without blocking.
 o close
  protected abstract void close() throws IOException
Closes the socket.
 o getFileDescriptor
  protected FileDescriptor getFileDescriptor()
 o getInetAddress
  protected InetAddress getInetAddress()
 o getPort
  protected int getPort()
 o getLocalPort
  protected int getLocalPort()
 o toString
  public String toString()
Returns the address and port of this Socket as a String.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index