10 /** Class IoTSocketServer is a communication class
11 * that extends IoTSocket. This is the server side.
13 * Adapted from Java/C++ socket implementation
15 * @see <a href="https://www.keithv.com/software/socket/</a>
17 * @author Rahmadi Trimananda <rtrimana @ uci.edu>
21 public final class IoTSocketServer extends IoTSocket {
31 public IoTSocketServer(int _port) throws IOException
35 server = new ServerSocket(port, 100);
37 catch ( IOException e ) {
44 * Establish connection
46 public void connect() throws IOException
48 byte rev[] = new byte[1];
50 sock = server.accept();
51 input = new BufferedInputStream(sock.getInputStream(), BUFFSIZE);
52 output = new BufferedOutputStream(sock.getOutputStream(),BUFFSIZE);
53 // now find out if we want reversed bytes