java.net
Class ANEPSocketImpl

java.lang.Object
  |
  +--java.net.ANEPSocketImpl
All Implemented Interfaces:
SocketOptions

public abstract class ANEPSocketImpl
extends java.lang.Object
implements SocketOptions

Abstract ANEP datagram and multicast socket implementation base class.


Field Summary
protected  int discardFlag
           
protected  java.io.FileDescriptor fd
          The file descriptor object
 
Fields inherited from interface java.net.SocketOptions
ANEP_DISCARD, IP_MULTICAST_IF, IPV6_AUTH_NETWORK_LEVEL, IPV6_AUTH_TRANS_LEVEL, IPV6_ESP_NETWORK_LEVEL, IPV6_ESP_TRANS_LEVEL, IPV6_FLOW_LABEL, IPV6_MULTICAST_IF, IPV6_TRAFFIC_CLASS, SO_BINDADDR, SO_LINGER, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
 
Constructor Summary
ANEPSocketImpl()
           
 
Method Summary
protected abstract  void allowOptionTypes(int[] optionTypes)
          Options that are allowed to be received
protected abstract  void bind(int ltype, InetAddress laddr)
          Binds a datagram socket to a local port and address.
protected abstract  void close()
          Close the socket.
protected abstract  void create()
          Creates a datagram socket
protected  java.io.FileDescriptor getFileDescriptor()
          Get the ANEP socket file descriptor
protected abstract  int getHOPS()
          Retrieve the TTL (time-to-live) option.
protected abstract  void join(InetAddress inetaddr)
          Join the multicast group.
protected abstract  void leave(InetAddress inetaddr)
          Leave the multicast group.
protected abstract  int peek(InetAddress i)
          Peek at the packet to see who it is from.
protected abstract  void receive(ANEPPacket p)
          Receive the datagram packet.
protected abstract  void send(ANEPPacket p)
          Sends a datagram packet.
protected abstract  void setHOPS(int hops)
          Set the TTL (time-to-live) option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.net.SocketOptions
getOption, setOption
 

Field Detail

fd

protected java.io.FileDescriptor fd
The file descriptor object

discardFlag

protected int discardFlag
Constructor Detail

ANEPSocketImpl

public ANEPSocketImpl()
Method Detail

allowOptionTypes

protected abstract void allowOptionTypes(int[] optionTypes)
                                  throws java.net.SocketException
Options that are allowed to be received
Parameters:
optionTypes - array of option types

create

protected abstract void create()
                        throws java.net.SocketException
Creates a datagram socket

bind

protected abstract void bind(int ltype,
                             InetAddress laddr)
                      throws java.io.IOException
Binds a datagram socket to a local port and address.

send

protected abstract void send(ANEPPacket p)
                      throws java.io.IOException
Sends a datagram packet. The packet contains the data and the destination address to send the packet to.
Parameters:
packet - to be sent.

peek

protected abstract int peek(InetAddress i)
                     throws java.io.IOException
Peek at the packet to see who it is from.
Parameters:
return - the address which the packet came from.

receive

protected abstract void receive(ANEPPacket p)
                         throws java.io.IOException
Receive the datagram packet.
Parameters:
Packet - Received.

setHOPS

protected abstract void setHOPS(int hops)
                         throws java.io.IOException
Set the TTL (time-to-live) option.
Parameters:
TTL - to be set.

getHOPS

protected abstract int getHOPS()
                        throws java.io.IOException
Retrieve the TTL (time-to-live) option.

join

protected abstract void join(InetAddress inetaddr)
                      throws java.io.IOException
Join the multicast group.
Parameters:
multicast - address to join.

leave

protected abstract void leave(InetAddress inetaddr)
                       throws java.io.IOException
Leave the multicast group.
Parameters:
multicast - address to leave.

close

protected abstract void close()
Close the socket.

getFileDescriptor

protected java.io.FileDescriptor getFileDescriptor()
Get the ANEP socket file descriptor