|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.DatagramSocket
nl.openfortress.socket6bed4.DatagramSocket6bed4
public class DatagramSocket6bed4
Socket6bed4 describes sockets that are run over IPv6. This means that a remote IPv6 address can be contacted when there are only IPv4 addresses available locally. A Socket6bed4 can switch between IPv4 transports; it can either send to a 6bed4 server, or directly to the targeted peer. Either path is acceptable as. The Socket can arrange this automatically, using peering attempts through Neighbor Discovery. Perhaps it's a bit silly to make a 6bed4 DatagramSocket a subclass of a plain DatagramSocket. It is very practical however; it means that these objects can be substituted anywhere, without question.
Field Summary | |
---|---|
protected InetSocketAddress |
cnx6sa
|
protected int |
ephemeral
|
protected DatagramSocket |
ipv4socket
|
protected InetSocketAddress |
my6sa
|
protected ServerNode |
my6sn
|
protected byte[] |
prephdr_udp
|
protected static DatagramSocket |
server_ipv4socket
|
Constructor Summary | |
---|---|
DatagramSocket6bed4()
|
|
DatagramSocket6bed4(DatagramSocketImpl impl)
|
|
DatagramSocket6bed4(InetSocketAddress bindaddr)
Construct a new DatagramSocket6bed4 based on an underlying DatagramSocket for IPv4. |
|
DatagramSocket6bed4(int port)
|
|
DatagramSocket6bed4(int port,
Inet6Address bindaddr)
|
Method Summary | |
---|---|
void |
acknowledge_playful(Inet6Address ia6bed4)
In a playfully hinting exchange with send_playful() and receive_playful(), this is the final acknowledgement that should be called upon completion. |
void |
bind(InetSocketAddress sa)
Attempt to bind to an address and/or port, exercising 6bed4 constraints as they arise from the router advertisement. |
void |
bind(int port)
|
void |
connect(InetAddress address,
int port)
Connect to a remote IPv6 address and UDP port. |
void |
connect(InetSocketAddress addr)
|
void |
disconnect()
Disconnect from a remote IPv6 address and UDP port. |
InetAddress |
getInetAddress()
Return currect remote address |
InetAddress |
getLocalAddress()
Return local address |
int |
getLocalPort()
Return local port |
InetSocketAddress |
getLocalSocketAddress()
Return bound local socket address |
int |
getPort()
Return currect local port |
InetSocketAddress |
getRemoteSocketAddress()
Return remote sock address |
boolean |
isBound()
Are we bound? |
boolean |
isConnected()
Are we connected? |
boolean |
receive_playful(DatagramPacket pkt6)
Receive a packet from the underlying IPv4 layer. |
void |
receive(DatagramPacket pkt6)
The "standard" interface for receiving bytes, overriding the parent function and not supporting playful operation. |
void |
send_playful(DatagramPacket pkt6,
boolean playful)
The interface for DatagramPackets conceals the UDP layer underlaying the actual data exchanged. |
void |
send(DatagramPacket pkt6)
The "standard" interface for sending bytes, overriding the parent function and not sending playful hints. |
void |
setDefaultServer(Inet4Address server4,
int port4)
|
void |
useDefaultServer()
|
Methods inherited from class java.net.DatagramSocket |
---|
bind, close, connect, getBroadcast, getChannel, getReceiveBufferSize, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, isClosed, setBroadcast, setDatagramSocketImplFactory, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static DatagramSocket server_ipv4socket
protected DatagramSocket ipv4socket
protected InetSocketAddress cnx6sa
protected InetSocketAddress my6sa
protected ServerNode my6sn
protected int ephemeral
protected byte[] prephdr_udp
Constructor Detail |
---|
public DatagramSocket6bed4(InetSocketAddress bindaddr) throws SocketException
SocketException
public DatagramSocket6bed4(int port, Inet6Address bindaddr) throws SocketException
SocketException
public DatagramSocket6bed4(int port) throws SocketException
SocketException
public DatagramSocket6bed4() throws SocketException
SocketException
public DatagramSocket6bed4(DatagramSocketImpl impl) throws SocketException
SocketException
Method Detail |
---|
public void useDefaultServer()
public void setDefaultServer(Inet4Address server4, int port4) throws SocketException
SocketException
public InetAddress getInetAddress()
getInetAddress
in class DatagramSocket
public int getPort()
getPort
in class DatagramSocket
public InetSocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class DatagramSocket
public InetAddress getLocalAddress()
getLocalAddress
in class DatagramSocket
public int getLocalPort()
getLocalPort
in class DatagramSocket
public InetSocketAddress getLocalSocketAddress()
getLocalSocketAddress
in class DatagramSocket
public void bind(int port) throws SocketException
SocketException
public void bind(InetSocketAddress sa) throws SocketException
SocketException
public boolean isBound()
isBound
in class DatagramSocket
public void connect(InetAddress address, int port)
connect
in class DatagramSocket
public void connect(InetSocketAddress addr)
public void disconnect()
disconnect
in class DatagramSocket
public boolean isConnected()
isConnected
in class DatagramSocket
public void send_playful(DatagramPacket pkt6, boolean playful) throws IOException
IOException
public boolean receive_playful(DatagramPacket pkt6) throws IOException
IOException
public void acknowledge_playful(Inet6Address ia6bed4)
public void send(DatagramPacket pkt6) throws IOException
send
in class DatagramSocket
IOException
public void receive(DatagramPacket pkt6) throws IOException
receive
in class DatagramSocket
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |