com.sparshui.common.ClientProtocol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmol Show documentation
Show all versions of jmol Show documentation
Jmol: an open-source Java viewer for chemical structures in 3D
package com.sparshui.common;
//import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
/**
* The abstract class for the client protocol that defines members
* common to both the server-side and client-side protocols.
*
* @author Tony Ross
*
*/
public abstract class ClientProtocol {
/**
*
*/
protected Socket _socket;
/**
*
*/
protected DataInputStream _in;
/**
*
*/
protected DataOutputStream _out;
/**
* Create a new ClientProtocol object.
*
* @param socket
* The socket that has been opened.
* @throws IOException
* If there is a communication error.
*/
public ClientProtocol(Socket socket) throws IOException {
_socket = socket;
_in = new DataInputStream(_socket.getInputStream());
_out = new DataOutputStream(_socket.getOutputStream());
}
/**
*
* @author tross
*
*/
protected class MessageType {
/**
*
*/
public static final int EVENT = 0;
/**
*
*/
public static final int GET_GROUP_ID = 1;
/**
*
*/
public static final int GET_ALLOWED_GESTURES = 2;
}
}