verinec.netsim.util.net.sockets.fsm
Class SocketImplClosed

java.lang.Object
  extended by java.net.SocketImpl
      extended by verinec.netsim.util.net.sockets.fsm.FSMSocketImpl
          extended by verinec.netsim.util.net.sockets.fsm.SocketImplClosed
All Implemented Interfaces:
SocketOptions

public class SocketImplClosed
extends FSMSocketImpl

A SocketImpl in closed state

Version:
$Revision: 662 $
Author:
Dominik Jungo

Field Summary
private  int backlog
           
private  Vector SocketImpls
           
 
Fields inherited from class verinec.netsim.util.net.sockets.fsm.FSMSocketImpl
jlogger, parent
 
Fields inherited from class java.net.SocketImpl
address, fd, localport, port
 
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
 
Constructor Summary
SocketImplClosed(SocketImpl parent)
          Creates a new SocketImpl in closed state.
 
Method Summary
protected  void accept(SocketImpl s)
           
protected  int available()
           
protected  void bind(InetAddress host, int port)
           
protected  void close()
           
protected  void connect(InetAddress address, int port)
           
protected  void connect(SocketAddress address, int timeout)
           
protected  void connect(String host, int port)
           
protected  InputStream getInputStream()
           
protected  OutputStream getOutputStream()
           
 SocketImpl getSocketImpl(int localport, IAddress remoteaddress, int remoteport)
          gets a bound socket from this host, null if there isn't a bound socket with specified parameters
 void proccessUp(Packet packet)
          Proccesses an incoming packet
protected  void sendUrgentData(int data)
           
 void setBacklog(int backlog)
          Sets the number of accpeting connections
 
Methods inherited from class verinec.netsim.util.net.sockets.fsm.FSMSocketImpl
create, faccept, favailable, fbind, fclose, fconnect, fconnect, fconnect, fcreate, fgetInputStream, fgetOutputStream, fsendUrgentData, getOption, listen, setOption
 
Methods inherited from class java.net.SocketImpl
getFileDescriptor, getInetAddress, getLocalPort, getPort, setPerformancePreferences, shutdownInput, shutdownOutput, supportsUrgentData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SocketImpls

private Vector SocketImpls

backlog

private int backlog
Constructor Detail

SocketImplClosed

public SocketImplClosed(SocketImpl parent)
Creates a new SocketImpl in closed state.

Parameters:
parent - the SocketImpl used by the Socket
Method Detail

available

protected int available()
                 throws IOException
Specified by:
available in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.available()

close

protected void close()
              throws IOException
Specified by:
close in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.close()

sendUrgentData

protected void sendUrgentData(int data)
                       throws IOException
Specified by:
sendUrgentData in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.sendUrgentData(int)

getInputStream

protected InputStream getInputStream()
                              throws IOException
Specified by:
getInputStream in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.getInputStream()

getOutputStream

protected OutputStream getOutputStream()
                                throws IOException
Specified by:
getOutputStream in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.getOutputStream()

connect

protected void connect(String host,
                       int port)
                throws IOException
Specified by:
connect in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.connect(java.lang.String, int)

bind

protected void bind(InetAddress host,
                    int port)
             throws IOException
Specified by:
bind in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.bind(java.net.InetAddress, int)

connect

protected void connect(InetAddress address,
                       int port)
                throws IOException
Specified by:
connect in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.connect(java.net.InetAddress, int)

connect

protected void connect(SocketAddress address,
                       int timeout)
                throws IOException
Specified by:
connect in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.connect(java.net.SocketAddress, int)

accept

protected void accept(SocketImpl s)
               throws IOException
Specified by:
accept in class SocketImpl
Throws:
IOException
See Also:
SocketImpl.accept(java.net.SocketImpl)

proccessUp

public void proccessUp(Packet packet)
Description copied from class: FSMSocketImpl
Proccesses an incoming packet

Specified by:
proccessUp in class FSMSocketImpl
Parameters:
packet - a packet to be proccessed
See Also:
FSMSocketImpl.proccessUp(verinec.netsim.entities.packets.Packet)

setBacklog

public void setBacklog(int backlog)
Sets the number of accpeting connections

Overrides:
setBacklog in class FSMSocketImpl
Parameters:
backlog - the number of accpeting connections

getSocketImpl

public SocketImpl getSocketImpl(int localport,
                                IAddress remoteaddress,
                                int remoteport)
gets a bound socket from this host, null if there isn't a bound socket with specified parameters

Parameters:
localport - localport of the bound socket
remoteaddress - remote adddress of the bound socket
remoteport - remote port of the bound socket
Returns:
the bound socket

Copyright © 2005 Verinec, DIUF