Package com.sparshui.server
Class ServerToClientProtocol
java.lang.Object
com.sparshui.common.ClientProtocol
com.sparshui.server.ServerToClientProtocol
Represents the server to client connection.
- Author:
- Tony Ross
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sparshui.common.ClientProtocol
ClientProtocol.MessageType
-
Field Summary
Fields inherited from class com.sparshui.common.ClientProtocol
_in, _out, _socket
-
Constructor Summary
ConstructorsConstructorDescriptionServerToClientProtocol
(Socket socket) Constructs a new connection to the client. -
Method Summary
Modifier and TypeMethodDescriptiongetGestures
(int groupID) Retrieve a list of allowed gestures for the provided group id.int
getGroupID
(TouchPoint touchPoint) Retrieve a list of allowed gestures for the provided group id.void
processError
(int errCode) Send an error message to the client.void
processEvents
(int groupID, Lst<Event> events) Instruct the client to process the events that have been generated by a group.
-
Constructor Details
-
ServerToClientProtocol
Constructs a new connection to the client.- Parameters:
socket
- The socket that has been opened to the client.- Throws:
IOException
-
-
Method Details
-
getGestures
Retrieve a list of allowed gestures for the provided group id. The message sent is of the following format: 1 byte - Event Type 4 bytes - Message Length 4 bytes - GroupID- Parameters:
groupID
- The ID of the group to obtain allowed gestures for- Returns:
- A list containing string identifiers for all allowed gestures
- Throws:
IOException
- If an error occurs while communication with the client.
-
getGroupID
Retrieve a list of allowed gestures for the provided group id. The message sent is of the following format: 1 byte - Event Type 4 bytes - Message Length 4 bytes - x coordinate 4 bytes - y coordinate- Parameters:
touchPoint
- The data point for the group to retrieve from- Returns:
- The Group ID
- Throws:
IOException
- If an error occurs during communication with the client.
-
processEvents
Instruct the client to process the events that have been generated by a group.- Parameters:
groupID
- The group ID these events have been generated on.events
-- Throws:
IOException
- If there is a communication error.
-
processError
Send an error message to the client.- Parameters:
errCode
- EventType.DRIVER_NONE- Throws:
IOException
- If there is a communication error.
-