|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--inria.net.MulticastSession
an abstract class for managing a multicast/unicast session over DatagramSocket.
Field Summary | |
protected int |
bytes
|
protected java.net.InetAddress |
inetAddr
|
protected int |
MaxPacketSize
|
protected int |
packets
|
protected int |
port
|
protected java.net.DatagramSocket |
sock_in
|
protected java.net.DatagramSocket |
sock_out
|
protected java.lang.Thread |
thread
|
protected int |
ttl
|
Constructor Summary | |
protected |
MulticastSession()
creates a MulticastSession object. |
Method Summary | |
int |
bytes()
returns the total number of bytes received. |
int |
getTTL()
gets the TTL value. |
protected void |
initialize(java.net.InetAddress addr,
int port)
creates MulticastSocket or DatagramSocket according to the class of the given IP address. |
protected void |
initialize(java.lang.String addr,
int port)
creates MulticastSocket or DatagramSocket according to the class of the given IP address. |
static boolean |
isMulticast(java.net.InetAddress addr)
returns true if the address is in class D. |
int |
packets()
returns the total number of packets received. |
protected abstract boolean |
parse(byte[] buff,
int datalen,
java.net.InetAddress addr)
parses a received data packet. |
void |
run()
starts to receive packets from the session. |
void |
send(byte[] buff,
int len)
sends data to the session using the session TTL. |
void |
send(byte[] buf,
int len,
int ttl)
sends data to the session using the provided TTL. |
void |
setTTL(int t)
sets the TTL for a multicast session. |
void |
start()
starts the session. |
void |
stop()
stops the session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int MaxPacketSize
protected int port
protected int ttl
protected java.net.InetAddress inetAddr
protected java.net.DatagramSocket sock_in
protected java.net.DatagramSocket sock_out
protected int packets
protected int bytes
protected java.lang.Thread thread
Constructor Detail |
protected MulticastSession()
Method Detail |
public void start()
public void stop()
protected void initialize(java.net.InetAddress addr, int port) throws java.io.IOException
addr
- the destination address.port
- the port to use.java.io.IOException
- is raised if there is an error in creating socket.protected void initialize(java.lang.String addr, int port) throws java.io.IOException, java.net.UnknownHostException
addr
- the destination address.port
- the port to use.java.net.UnknownHostException
- is raised if bad address.java.io.IOException
- is raised if there is an error in creating socket.public void setTTL(int t)
t
- TTL.public int getTTL()
public void send(byte[] buff, int len)
buff
- the data buffer.len
- the data length in the buffer.public void send(byte[] buf, int len, int ttl)
buff
- the data buffer.len
- the data length in the buffer.ttl
- the ttl value to use.protected abstract boolean parse(byte[] buff, int datalen, java.net.InetAddress addr)
buff
- the data buffer.datalen
- the data length in the buffer.addr
- the source network address.public void run()
run
in interface java.lang.Runnable
public static boolean isMulticast(java.net.InetAddress addr)
addr
- address to check.public int packets()
public int bytes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.