bubolo
 All Classes Namespaces Functions Variables Enumerator
Public Member Functions | Package Functions | List of all members
bubolo.net.Connections Class Reference
Inheritance diagram for bubolo.net.Connections:

Public Member Functions

void run ()
 

Package Functions

 Connections (Network networkSystem, ServerSocket server)
 
boolean isActive ()
 
void addCommand (NetworkCommand command)
 
void addConnection (Socket socket)
 
void destroy ()
 
void update ()
 

Detailed Description

Runnable that accepts client connections, queues NetworkCommands, and sends the queued commands over the network.

Author
BU CS673 - Clone Productions

Definition at line 20 of file Connections.java.

Constructor & Destructor Documentation

bubolo.net.Connections.Connections ( Network  networkSystem,
ServerSocket  server 
)
package

Constructs a new Server object.

Parameters
networkSystemreference to the network system.
serverreference to an instantiated server socket.

Definition at line 41 of file Connections.java.

Member Function Documentation

void bubolo.net.Connections.addCommand ( NetworkCommand  command)
package

Queues a network command that will be sent to the other players.

Parameters
commandthe network command to send.

Definition at line 62 of file Connections.java.

void bubolo.net.Connections.addConnection ( Socket  socket)
package

Adds a connection to the list.

Parameters
socketa connected socket.

Definition at line 71 of file Connections.java.

void bubolo.net.Connections.destroy ( )
package

Closes all active connections.

Definition at line 79 of file Connections.java.

boolean bubolo.net.Connections.isActive ( )
package

Specifies whether the Connections object is active.

Returns
true if the Connections object is active.

Definition at line 53 of file Connections.java.

void bubolo.net.Connections.run ( )

Accepts connections from clients, and adds them to the client list.

Definition at line 125 of file Connections.java.

References bubolo.net.Network.isActive().

void bubolo.net.Connections.update ( )
package

Sends queued network commands across the network.

Definition at line 91 of file Connections.java.