Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 392
نمايش فراداده

SocketImpljava.net

Java 1.0

This abstract class defines the methods necessary to implement communication through sockets. Different subclasses of this class may provide different implementations suitable in different environments (such as behind firewalls). These socket implementations are used by the Socket and ServerSocket classes. Normal applications never need to use or subclass this class.

Figure 12-20. java.net.SocketImpl

public abstract class

SocketImpl implements SocketOptions { // Public Constructors public

SocketImpl ( ); // Public Methods Overriding Object public String

toString ( ); // Protected Instance Methods protected abstract void

accept (SocketImpl

s ) throws java.io.IOException; protected abstract int

available ( ) throws java.io.IOException; protected abstract void

bind (InetAddress

host , int

port ) throws java.io.IOException; protected abstract void

close ( ) throws java.io.IOException; protected abstract void

connect (String

host , int

port ) throws java.io.IOException; protected abstract void

connect (InetAddress

address , int

port ) throws java.io.IOException;

1.4 protected abstract void

connect (SocketAddress

address , int

timeout ) throws java.io.IOException; protected abstract void

create (boolean

stream ) throws java.io.IOException; protected java.io.FileDescriptor

getFileDescriptor ( ); protected InetAddress

getInetAddress ( ); protected abstract java.io.InputStream

getInputStream ( ) throws java.io.IOException; protected int

getLocalPort ( ); protected abstract java.io.OutputStream

getOutputStream ( ) throws java.io.IOException; protected int

getPort ( ); protected abstract void

listen (int

backlog ) throws java.io.IOException;

1.4 protected abstract void

sendUrgentData (int

data ) throws java.io.IOException;

5.0 protected void

setPerformancePreferences (int

connectionTime , int

latency , int

bandwidth ); empty

1.3 protected void

shutdownInput ( ) throws java.io.IOException;

1.3 protected void

shutdownOutput ( ) throws java.io.IOException;

1.4 protected boolean

supportsUrgentData ( ); constant // Protected Instance Fields protected InetAddress

address ; protected java.io.FileDescriptor

fd ; protected int

localport ; protected int

port ; }

Passed To

Socket.Socket( )

Returned By

SocketImplFactory.createSocketImpl( )