net.javacrumbs.mocksocket
Class AbstractMockSocketImpl
java.lang.Object
java.net.SocketImpl
net.javacrumbs.mocksocket.AbstractMockSocketImpl
- All Implemented Interfaces:
- SocketOptions
- Direct Known Subclasses:
- ConnectionFactoryMockSocketImpl
public abstract class AbstractMockSocketImpl
- extends SocketImpl
| Fields inherited from interface java.net.SocketOptions |
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY |
| Methods inherited from class java.net.SocketImpl |
getFileDescriptor, getInetAddress, getInputStream, getLocalPort, getOutputStream, getPort, setPerformancePreferences, shutdownInput, shutdownOutput, supportsUrgentData, toString |
AbstractMockSocketImpl
public AbstractMockSocketImpl()
onConnect
protected abstract void onConnect(String address)
- Onvoked on a connect method call.
- Parameters:
address - host:port
setOption
public void setOption(int optID,
Object value)
throws SocketException
- Throws:
SocketException
getOption
public Object getOption(int optID)
throws SocketException
- Throws:
SocketException
create
protected void create(boolean stream)
throws IOException
- Specified by:
create in class SocketImpl
- Throws:
IOException
connect
protected void connect(String host,
int port)
throws IOException
- Specified by:
connect in class SocketImpl
- Throws:
IOException
connect
protected void connect(InetAddress address,
int port)
throws IOException
- Specified by:
connect in class SocketImpl
- Throws:
IOException
connect
protected void connect(SocketAddress address,
int timeout)
throws IOException
- Specified by:
connect in class SocketImpl
- Throws:
IOException
bind
protected void bind(InetAddress host,
int port)
throws IOException
- Specified by:
bind in class SocketImpl
- Throws:
IOException
listen
protected void listen(int backlog)
throws IOException
- Specified by:
listen in class SocketImpl
- Throws:
IOException
accept
protected void accept(SocketImpl s)
throws IOException
- Specified by:
accept in class SocketImpl
- Throws:
IOException
available
protected int available()
throws IOException
- Specified by:
available in class SocketImpl
- Throws:
IOException
sendUrgentData
protected void sendUrgentData(int data)
throws IOException
- Specified by:
sendUrgentData in class SocketImpl
- Throws:
IOException
close
protected void close()
throws IOException
- Specified by:
close in class SocketImpl
- Throws:
IOException
Copyright © 2011. All Rights Reserved.