B C D F G H I J L M N R S T U

B

BAToInt(byte[], int) - Static method in class util.Util
Convert byte[offset]...byte[offset+3] to integer.
BAToInt(byte[]) - Static method in class util.Util
Convert byte[0]...buf[3] to integer.
BAToShort(byte[], int) - Static method in class util.Util
Convert buf[offset] buf[offset+1] to int in range 0..65535
BAToShort(byte[]) - Static method in class util.Util
Convert buf[0] buf[1] to int in range 0..65535
buf - Variable in class mcast.MCastPacket
 
BUFFER_SIZE - Static variable in class mcast.MCastSocket
Size of inComingPktBuf.
BUFFER_SIZE - Variable in class mcast.TOMCastSocket
A not-very-respected limit on the number of packets to be buffered.

C

chatapp - package chatapp
 
ChatClient - Class in chatapp
The chat client.
ChatClient(String, String, int, int, int) - Constructor for class chatapp.ChatClient
A lot of parameters are required.
ChatClient.ReceiveHelper - Class in chatapp
Like most everything else, the chat client is multithreaded.
ChatClient.ReceiveHelper() - Constructor for class chatapp.ChatClient.ReceiveHelper
 
CLIENT_CLIENT_GOODBYE - Static variable in class mcast.MCastPacket
Packet type Sent to all clients in the mcast group when one is done sending and wants to leave the group.
CLIENT_MCAST - Static variable in class mcast.MCastPacket
Packet type A normal client multicast msg, presumably carrying some data payload.
CLIENT_SERVER_HELLO - Static variable in class mcast.MCastPacket
Packet type part of the join protocol; the client tells lobby it's here, and waits to hear back before allowing the user thread to continue.
clock - Variable in class mcast.TOMCastSocket
Our Lamport clock.
close() - Method in class util.Logger
 
CLOSED - Static variable in class mcast.MCastSocket
Socket state All clients have left the group.
CONNECTED - Static variable in class mcast.MCastSocket
Socket state Socket is part of Mcast group (has heard a SERVER_CLIENT_HELLO and now knows who all is in the mcast group).

D

DRAINED - Static variable in class mcast.MCastSocket
Socket state There are no more packets in the received queue, and none on the network (i.e., there will never again be one available for receiving).
drained - Variable in class mcast.TOMCastSocket
Set to true once there are no more packets in the receive queue and there will never be any again.

F

file - Variable in class util.Logger
 

G

getAddress() - Method in class mcast.MCastPacket
Returns the address of the packet (useful when receiving a packet).
getBuf() - Method in class mcast.MCastPacket
Gets a reference to the lowest level (datagram packet) buffer.
getClientId(MCastPacket) - Method in class mcast.MCastSocket
Returns a "client id" - an integer in the range 0..getMCastGroupSize()-1.
getClock() - Method in class mcast.TOMCastPacket
 
getDGPacket() - Method in class mcast.MCastPacket
Provides access to the contained DG packet, which is required to set or get packet addresses (or to directly manipulate packet lengths).
getMCastGroupSize() - Method in class mcast.MCastSocket
Returns the number of clients in the mcast group.
getPayload() - Method in class mcast.MCastPacket
Returns the payload - everything past the MCastPacket header.
getPayload() - Method in class mcast.TOMCastPacket
 
getPayloadLength() - Method in class mcast.MCastPacket
Returns the number of bytes in the packet past the MCastPacket header.
getPayloadLength() - Method in class mcast.TOMCastPacket
 
getType() - Method in class mcast.MCastPacket
Extracts the packet type from the header and returns it.
groupMembers - Variable in class mcast.MCastSocket
Addresses of mcast group members.

H

HEADER_SIZE - Static variable in class mcast.MCastPacket
 
HEADER_SIZE - Static variable in class mcast.TOMCastPacket
 

I

inComingPktBuf - Variable in class mcast.MCastSocket
The queue of packets available for the client to receive().
inComingPktBuf - Variable in class mcast.TOMCastSocket
The ordered queue of packets to be given to the caller of receive().
incrementClock() - Method in class mcast.TOMCastSocket
This is one of two routines that updates the clock in a thread safe way.
InetAddrToHost(InetSocketAddress) - Static method in class util.Util
 
init() - Method in class mcast.MCastSocket
Private function to initialize (called by constructors).
IntToBA(int, byte[], int) - Static method in class util.Util
Write integer into buf[offset]...buf[offset+3]
IntToBA(int, byte[]) - Static method in class util.Util
Write integer into buf[0]...buf[3]

J

join(String, int) - Method in class mcast.MCastSocket
Blocks the calling thread until the mcast group is joined.

L

leave() - Method in class mcast.MCastSocket
leave() is called by client when it's done sending.
Lobby - Class in mcast
Lobby: a server to register yourself as a member of the mcast group, and to find out who else is in the group.
Lobby(int, int) - Constructor for class mcast.Lobby
 
lobbyAddress - Variable in class mcast.MCastSocket
Location of the lobby (provider by creator of this object).
log(String) - Method in class util.Logger
 
logger - Variable in class chatapp.ChatClient
An object encapsulating creation of a log file.
Logger - Class in util
Utility class to write a log file.
Logger(String) - Constructor for class util.Logger
 

M

main(String[]) - Static method in class chatapp.ChatClient
 
main(String[]) - Static method in class mcast.Lobby
Lobby is invoked as java -classpath classes mcast.Lobby port n where port is the lobby port to use and n is the number of clients that will join the group.
main(String[]) - Static method in class util.Util
Unit test.
MAX_PACKET_SIZE - Static variable in class mcast.MCastPacket
 
MAX_PAYLOAD_SIZE - Static variable in class mcast.MCastPacket
 
mcast - package mcast
 
MCastPacket - Class in mcast
An MCastPacket is a:
MCastPacket() - Constructor for class mcast.MCastPacket
By default, create a packet with type suitable for client sending.
MCastPacket(int) - Constructor for class mcast.MCastPacket
Constructor for outgoing packets.
MCastPacket(DatagramPacket) - Constructor for class mcast.MCastPacket
Constructor for incoming packets.
MCastSocket - Class in mcast
MCastSocket: implements basic multicast transport.
MCastSocket() - Constructor for class mcast.MCastSocket
Creates a new MCastSocket, obtaining an ephemeral (random) port number.
MCastSocket(int) - Constructor for class mcast.MCastSocket
Creates a new MCastSocket with a specified port number.
MCastSocket.ReceiveHelper - Class in mcast
Helper class to implement receiving thread.
MCastSocket.ReceiveHelper() - Constructor for class mcast.MCastSocket.ReceiveHelper
 
myDGPacket - Variable in class mcast.MCastPacket
 
mySocket - Variable in class mcast.MCastSocket
The socket actually used to send and receive to/from the network.

N

numDeparted - Variable in class mcast.MCastSocket
Number of clients who have departed (i.e., promised they will send no more packets to the mcast group).

R

receive() - Method in class mcast.MCastSocket
 
receive() - Method in class mcast.TOMCastSocket
Receive blocks if nothing is available right now.
receivePkt - Variable in class chatapp.ChatClient
The packet used by the receive thread (to hold incoming data).
receiver - Variable in class mcast.MCastSocket
The receive thread (takes packets off network and puts them in a packet buffer).
receiver - Variable in class mcast.TOMCastSocket
A TOMCastSocket uses a separate thread on the receive side.
run() - Method in class chatapp.ChatClient.ReceiveHelper
 
run() - Method in class mcast.MCastSocket.ReceiveHelper
 
run() - Method in class mcast.TOMCastSocket
This is the receive thread loop, invoked when the thread is started.

S

send(MCastPacket) - Method in class mcast.MCastSocket
This is multicast send.
send(TOMCastPacket) - Method in class mcast.TOMCastSocket
This is multicast send.
sendPkt - Variable in class chatapp.ChatClient
The packet used by the send thread (to hold outgoing data).
SERVER_CLIENT_HELLO - Static variable in class mcast.MCastPacket
Packet type Once server has received HELLO msgs from all the clients it is expecting, it replies to each with one of these.
setAddress(InetSocketAddress) - Method in class mcast.MCastPacket
Sets the address of this packet (so useful when you're going to send the packet).
setClock(int) - Method in class mcast.TOMCastPacket
Sets the TOMCastPacket header clock field.
setPayload(byte[]) - Method in class mcast.MCastPacket
Sets the payload, as seen from the perspective of an MCastPacket.
setPayload(byte[]) - Method in class mcast.TOMCastPacket
Sets the payload: the packet bytes past the TOMCastPacket header.
setPayloadLength(int) - Method in class mcast.MCastPacket
Sets the payload length (in the underlying DatagramPacket).
setPayloadLength(int) - Method in class mcast.TOMCastPacket
Direct manipulation of the payload length.
setType(int) - Method in class mcast.MCastPacket
Set the MCastPacket type.
ShortToBA(int, byte[], int) - Static method in class util.Util
Write low-order 16-bits of val into buf[offset] buf[offset+1]
ShortToBA(int, byte[]) - Static method in class util.Util
Write low order 16-bits of val into buf[0] buf[1]
sock - Variable in class chatapp.ChatClient
The communication socket.
SOCKET_CLOSED - Static variable in class mcast.MCastPacket
Packet type A pseudo-type used by socket implementations to indicate that this is the last packet that can be received, ever.
STARTING - Static variable in class mcast.MCastSocket
Socket state Initial state: not yet connected.
startSem - Variable in class mcast.MCastSocket
Use to blocking user thread, in a call to join(), until receive thread notices that the mcast group has been joined.
state - Variable in class mcast.MCastSocket
Current state of the socket.

T

TOMCastPacket - Class in mcast
An TOMMCastPacket is a:
TOMCastPacket() - Constructor for class mcast.TOMCastPacket
Constructor for outgoing packets: creates packet with TOMCast header, but no payload.
TOMCastPacket(MCastPacket) - Constructor for class mcast.TOMCastPacket
Constructor for incoming packets: takes an MCastPacket received off the network and views it as a TOMCastPacket.
TOMCastSocket - Class in mcast
TOMCastSocket implements total ordering, on top of an MCastSocket, which provides (unordered) multicast.
TOMCastSocket() - Constructor for class mcast.TOMCastSocket
Create a TOMCastSock socket at an ephemeral port.
toString() - Method in class mcast.MCastPacket
The obligatory toString.
toString() - Method in class mcast.TOMCastPacket
The obligatory toString.

U

unicastSendTo(MCastPacket, InetSocketAddress) - Method in class mcast.MCastSocket
Private unicast send helper function.
updateClockWithMax(int) - Method in class mcast.TOMCastSocket
This is one of two routines that updates the clock in a thread safe way.
updateMCastClientList(String) - Method in class mcast.MCastSocket
Accept mcast client group message from lobby, parse it, can fill in group member data structure.
usage() - Static method in class chatapp.ChatClient
 
usage() - Static method in class mcast.Lobby
A gratuitous usage() message.
util - package util
 
Util - Class in util
Various static utility methods.
Util() - Constructor for class util.Util
 

B C D F G H I J L M N R S T U