Methods Summary |
---|
public void | accept(java.net.SocketImpl si)
try {
Socket sock = ss.accept();
((ASClientSocketImpl)si).setClientSocket(sock);
} catch (AsynchronousCloseException ase) {
SocketException se = new SocketException(ase.getMessage());
se.initCause(ase);
throw se;
}
|
public int | available()
throw new UnsupportedOperationException(
"available() not supported in ASServerSocketImpl");
|
public void | bind(java.net.InetAddress host, int port)
hostToBind = host;
portToBind = port;
// actual binding happens in listen() below, because listen() is
// called after bind() by java.net.ServerSocket.java.
|
public void | close()
if (ss != null && !ss.isClosed()) {
try {
ServerSocketChannel channelToClose = ssc;
ServerSocket socketToClose = ss;
if (ssc instanceof ASServerSocketChannel) {
ASServerSocketChannel assc =
(ASServerSocketChannel) ssc;
channelToClose = (ServerSocketChannel) assc.getActualChannel();
socketToClose = ssc.socket();
}
ASSocketFacadeUtils.getASSocketService().close(portToBind,
socketToClose, channelToClose);
} catch (IOException e) {
if ( logger.isLoggable(Level.FINE) ) {
logger.log(Level.FINE, ""+ e.getMessage(),e);
}
}
}
|
public void | connect(java.lang.String s, int i)
throw new UnsupportedOperationException(
"connect() not supported in ASServerSocketImpl");
|
public void | connect(java.net.InetAddress ia, int i)
throw new UnsupportedOperationException(
"connect() not supported in ASServerSocketImpl");
|
public void | connect(java.net.SocketAddress sa, int i)
throw new UnsupportedOperationException(
"connect() not supported in ASServerSocketImpl");
|
public void | create(boolean stream)
// No-op: stream is always true when called from ServerSocket
|
public java.io.InputStream | getInputStream()
throw new UnsupportedOperationException(
"getInputStream() not supported in ASServerSocketImpl");
|
public java.lang.Object | getOption(int opt)
switch (opt) {
case SO_TIMEOUT:
try {
return new Integer(ss.getSoTimeout());
} catch( IOException ioe ) {
throw new SocketException(ioe.getMessage()) ;
}
case SO_RCVBUF:
return new Integer(ss.getReceiveBufferSize());
case SO_REUSEADDR:
return new Boolean(ss.getReuseAddress());
default:
throw new SocketException("unrecognized TCP option: " + opt);
}
|
public java.io.OutputStream | getOutputStream()
throw new UnsupportedOperationException(
"getOutputStream() not supported in ASServerSocketImpl");
|
public void | listen(int backlog)
// Check for services that are not lazily initialized
if (!ASSocketFacadeUtils.getASSocketService().exists(portToBind)) {
ssc = ServerSocketChannel.open();
ss = ssc.socket();
} else {
ssc = ASSocketFacadeUtils.getASSocketService().
getServerSocketChannel(portToBind);
ss = ASSocketFacadeUtils.getASSocketService().
getServerSocket(portToBind);
}
InetSocketAddress isa = new InetSocketAddress(hostToBind, portToBind);
ss.bind(isa, backlog);
localport = ss.getLocalPort();
address = ss.getInetAddress();
|
public void | sendUrgentData(int i)
throw new UnsupportedOperationException(
"sendUrgentData() not supported in ASServerSocketImpl");
|
public void | setOption(int opt, java.lang.Object val)
if ( logger.isLoggable(Level.FINE) ) {
logger.log(java.util.logging.Level.FINE, "In ASServerSocketImpl.setOption, opt = "
+opt+" val = "+val, new Exception());
}
//Consider only those options that are settable in a ServerSocket
switch (opt) {
case SO_TIMEOUT:
if (val == null || (!(val instanceof Integer)))
throw new SocketException("Bad parameter for SO_TIMEOUT");
int tmp = ((Integer) val).intValue();
if (tmp < 0)
throw new IllegalArgumentException("timeout < 0");
ss.setSoTimeout( tmp );
break;
case SO_RCVBUF:
if (val == null || !(val instanceof Integer) ||
!(((Integer)val).intValue() > 0)) {
throw new SocketException("bad parameter for SO_SNDBUF " +
"or SO_RCVBUF");
}
ss.setReceiveBufferSize( ((Integer) val).intValue() );
break;
case SO_REUSEADDR:
if (val == null || !(val instanceof Boolean))
throw new SocketException("bad parameter for SO_REUSEADDR");
if (ss != null)
ss.setReuseAddress( ((Boolean)val).booleanValue() );
break;
default:
throw new SocketException("unrecognized TCP option: " + opt);
}
|
public void | shutdownInput()
throw new UnsupportedOperationException(
"shutdownInput() not supported in ASServerSocketImpl");
|
public void | shutdownOutput()
throw new UnsupportedOperationException(
"shutdownOutput() not supported in ASServerSocketImpl");
|
public boolean | supportsUrgentData()
throw new UnsupportedOperationException(
"supportsUrgentData() not supported in ASServerSocketImpl");
|