org.universAAL.lddi.zwave.exporter.Server
Interface ISocketServer

Package class diagram package ISocketServer
All Superinterfaces:
Closeable
All Known Implementing Classes:
AbstractSocketServer, AbstractSocketServerXSocket, MotionServer

public interface ISocketServer
extends Closeable

Socket server interface. All sockets servers will implement it.

Version:
$Rev: 5339 $ $Date: 2012-09-25 17:17:28 +0200 (mar, 25 sep 2012) $
Author:
fraperod

Method Summary
 void close()
          Gracefully close server.
 long getTotalReadBytes()
          Returns the total number of bytes read.
 long getTotalSentBytes()
          Retuns the total number of bytes sent.
 float getTransferRateIn()
          Incoming data transfer rate in bytes/second.
 float getTransferRateOut()
          Outgoing data transfer rate in bytes/second.
 void run()
          Starts server in current thread.
 void setIP(String ip)
          Sets the IP to be used by the server to bind the port for incoming connections.
 void setPort(int port)
          Sets the port to be used to listen for connections.
 void start()
          Starts server in independent thread.
 

Method Detail

close

void close()
           throws IOException
Gracefully close server.

Specified by:
close in interface Closeable
Throws:
IOException - exception raised while closing the server

getTotalReadBytes

long getTotalReadBytes()
Returns the total number of bytes read.

Returns:
the total number of bytes read

getTotalSentBytes

long getTotalSentBytes()
Retuns the total number of bytes sent.

Returns:
the total number of bytes sent

getTransferRateIn

float getTransferRateIn()
Incoming data transfer rate in bytes/second.

Returns:
the incoming data transfer rate in bytes/second

getTransferRateOut

float getTransferRateOut()
Outgoing data transfer rate in bytes/second.

Returns:
the Outgoing data transfer rate in bytes/second

run

void run()
         throws IOException
Starts server in current thread.

Throws:
IOException - exception raised while starting the server on a separated thread

setIP

void setIP(String ip)
Sets the IP to be used by the server to bind the port for incoming connections.

Parameters:
ip - server IP in string format: "xxx.xxxx.xxx.xxx"

setPort

void setPort(int port)
Sets the port to be used to listen for connections.

Parameters:
port - usded to listen for incoming connections

start

void start()
           throws IOException
Starts server in independent thread.

Throws:
IOException - exception raised while starting the server in independent thread


Copyright © 2014 universAAL Consortium. All Rights Reserved.