Package nl.tue.id.oocsi.client.socket

# Class SocketClientRunner

java.lang.Object
nl.tue.id.oocsi.client.socket.SocketClientRunner

All Implemented Interfaces:
  `java.lang.Runnable`

    public class SocketClientRunner
    extends java.lang.Object
    implements java.lang.Runnable

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `protected boolean` | `connectionEstablished` |

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `SocketClientRunner​(java.lang.String name, java.lang.String hostname, int port, java.util.Map<java.lang.String,​Handler> channels, java.util.Map<java.lang.String,​Responder> services)` |
  `SocketClientRunner​(java.lang.String name, java.lang.String hostname, int port, java.util.Map<java.lang.String,​Handler> channels, java.util.Map<java.lang.String,​Responder> services, boolean noPing, boolean noProcess)` | for testing only

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `void` | `disconnect()` | disconnect from OOCSI
  `void` | `handleMessage​(java.lang.String fromServer)` | handle a whole message
  `boolean` | `isConnected()` | check if still connected to OOCSI
  `protected boolean` | `isConnectionInProgress()` | return true if the connection is currently in progress
  `boolean` | `isReconnect()` | retrieve whether we are still trying to reconnect, or whether we have given up on this connection (server, handle, etc.)
  `void` | `kill()` | kills this client connection from OOCSI
  `void` | `log​(java.lang.String message)` | logging of message on console (can be overridden by subclass)
  `void` | `reconnect()` | reconnects this client connection to OOCSI
  `void` | `run()` |
  `protected void` | `sleep​(int ms)` | let thread sleep for ms milliseconds

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### connectionEstablished

    protected boolean connectionEstablished

- ## Constructor Details

  - ### SocketClientRunner

    public SocketClientRunner​(java.lang.String name, java.lang.String hostname, int port, java.util.Map<java.lang.String,​Handler> channels, java.util.Map<java.lang.String,​Responder> services)

  - ### SocketClientRunner

    public SocketClientRunner​(java.lang.String name, java.lang.String hostname, int port, java.util.Map<java.lang.String,​Handler> channels, java.util.Map<java.lang.String,​Responder> services, boolean noPing, boolean noProcess)
    for testing only
    Parameters:
      `name` -
      `hostname` -
      `port` -
      `channels` -
      `services` -
      `noPing` -
      `noProcess` -

- ## Method Details

  - ### run

    public void run()
    Specified by:
      `run` in interface `java.lang.Runnable`

  - ### isConnectionInProgress

    protected boolean isConnectionInProgress()
    return true if the connection is currently in progress
    Returns:

  - ### handleMessage

    public void handleMessage​(java.lang.String fromServer) throws java.io.IOException
    handle a whole message
    Parameters:
      `fromServer` -
    Throws:
      `java.io.IOException`

  - ### disconnect

    public void disconnect()
    disconnect from OOCSI

  - ### kill

    public void kill()
    kills this client connection from OOCSI

  - ### reconnect

    public void reconnect()
    reconnects this client connection to OOCSI

  - ### isConnected

    public boolean isConnected()
    check if still connected to OOCSI
    Returns:

  - ### isReconnect

    public boolean isReconnect()
    retrieve whether we are still trying to reconnect, or whether we have given up on this connection (server, handle, etc.)
    Returns:

  - ### sleep

    protected void sleep​(int ms)
    let thread sleep for ms milliseconds

  - ### log

    public void log​(java.lang.String message)
    logging of message on console (can be overridden by subclass)