edu.vt.marian.uip
Class server_uip_receiver

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--edu.vt.marian.uip.server_uip_receiver

public class server_uip_receiver
extends java.lang.Thread

class name: server_uip_receiver class description: this class is responsible to communicate with one client_uip, send rpc_function to and receive rpc_function from it through sockets

uses the services of class(es): designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): finished time: known bugs: JDK version: 1.1.5 side effects:


Field Summary
static int ACK_TIMEOUT
           
static int CLIENT_DISCONNECTED
           
static int ERROR_CONNECT_TO_CLIENT
           
static int ERROR_CREATE_STREAM
           
static int ERROR_SET_SOCKET_TIMEOUT
           
static int EXIT
           
static int INVALID_PARAMETER
           
static int NAK
          those are possible method return values
static int NEW_SESSION_ERROR
           
static int OK
          those are possible status
static int READ_ACK_ERROR
           
static int READ_FUNCTION_ERROR
           
static int SEND_FUNCTION_ERROR
           
static int WRITE_ERROR
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
server_uip_receiver(server_uip_receiver_table surt, int client_id, java.net.Socket s, int version, edu.vt.marian.common.Debug debug)
          method description: this constructor will create a server_uip_receiver object based on the information in the parameters.
 
Method Summary
 int exit(java.lang.String condition)
          method description: this method will let the object exit smoothly.
 int get_client_id()
          method description: this method will return the id of this object uses the services of class(es): input parameter(s): none output parameter(s): none return value: the id of this object as an integer synchronization consideration: none
 int get_status()
          method description: this method will return the current status of this object uses the services of class(es): input parameter(s): none output parameter(s): none return value: 0 -- every thing is fine other -- synchronization consideration: none
 int rpc_call(rpc_function rf)
          method description: this method will pass the rpc_function to the client_uip through socket uses the services of class(es): input parameter(s): rf -- the function need to be passed to the client_uip output parameter(s): none return value: none synchronization consideration: this is a synchronized method since it will write something to the socket and wait for reply
 void run()
          method description: this method of the thread will keep on reading rpc_functions from the socket connected to the client_uip.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK

public static final int OK
those are possible status

INVALID_PARAMETER

public static final int INVALID_PARAMETER

NEW_SESSION_ERROR

public static final int NEW_SESSION_ERROR

ERROR_CONNECT_TO_CLIENT

public static final int ERROR_CONNECT_TO_CLIENT

CLIENT_DISCONNECTED

public static final int CLIENT_DISCONNECTED

READ_ACK_ERROR

public static final int READ_ACK_ERROR

SEND_FUNCTION_ERROR

public static final int SEND_FUNCTION_ERROR

ACK_TIMEOUT

public static final int ACK_TIMEOUT

WRITE_ERROR

public static final int WRITE_ERROR

EXIT

public static final int EXIT

ERROR_CREATE_STREAM

public static final int ERROR_CREATE_STREAM

ERROR_SET_SOCKET_TIMEOUT

public static final int ERROR_SET_SOCKET_TIMEOUT

READ_FUNCTION_ERROR

public static final int READ_FUNCTION_ERROR

NAK

public static final int NAK
those are possible method return values
Constructor Detail

server_uip_receiver

public server_uip_receiver(server_uip_receiver_table surt,
                           int client_id,
                           java.net.Socket s,
                           int version,
                           edu.vt.marian.common.Debug debug)
method description: this constructor will create a server_uip_receiver object based on the information in the parameters.

uses the services of class(es): input parameter(s): surt -- the server_uip_receiver_table which created this object cleint_id -- used to identify this object in the server_uip_receiver _table s -- socket used to communicate with the client_uip version -- specifies how to pass and receive rpc_functions through sockets debug -- used for debugging output parameter(s): none return value: none synchronization consideration: none

Method Detail

run

public void run()
method description: this method of the thread will keep on reading rpc_functions from the socket connected to the client_uip.

uses the services of class(es): input parameter(s): none output parameter(s): none return value: none synchronization consideration: none

Overrides:
run in class java.lang.Thread

rpc_call

public int rpc_call(rpc_function rf)
method description: this method will pass the rpc_function to the client_uip through socket

uses the services of class(es): input parameter(s): rf -- the function need to be passed to the client_uip output parameter(s): none return value: none synchronization consideration: this is a synchronized method since it will write something to the socket and wait for reply


exit

public int exit(java.lang.String condition)
method description: this method will let the object exit smoothly.

uses the services of class(es): input parameter(s): condition --- under what condition is this method is called output parameter(s): none return value: 0 -- every thing is fine other -- synchronization consideration: none


get_status

public int get_status()
method description: this method will return the current status of this object

uses the services of class(es): input parameter(s): none output parameter(s): none return value: 0 -- every thing is fine other -- synchronization consideration: none


get_client_id

public int get_client_id()
method description: this method will return the id of this object

uses the services of class(es): input parameter(s): none output parameter(s): none return value: the id of this object as an integer synchronization consideration: none