class TcpIpServer

This class is a TcpIp Server Socket and listen on by dynamically getting free portIt Creates new TcpIp Server Socket.

Inheritance:


Public Methods

[more]void createServerSocket()
Creates new TcpIp Server Socket.
[more] TcpIpServer(int portNo)
Default constructor
[more] TcpIpServer(string n)
Basic constructor
[more]int run()
Starts the thread for TCP - IP Server


Inherited from Thread:

Public Fields

oithread_t threadId

Public Methods

oint start()
ostatic void* entryPoint(void*pthis)


Documentation

This class is a TcpIp Server Socket and listen on by dynamically getting free portIt Creates new TcpIp Server Socket. It also accept client socket connection. For each and every accepted client socket connection, it takes InputStream, Creates new InputThread instance by passing this InputStream and starts that created Thread.

This class consists following Inner classes..

TcpSocketInfo : This Inner class is used to store information about a socket opened with a client. It stores information such as...sessionId :: SessionId of client, socket :: Tcp/ip socket reference of client, timer :: counter indicates how much time elapsed in seconds since Tcp/ip server has sends last updates (real updates as well as empty updates) to client, sendUpdates :: boolean value indicates whether Tcp/ip server has send updates (real or empty)

TcpIpEmptyUpdates:It iterates the TcpSocketInfoList, and for each and every TcpSocketInfo instance, Send empty updates i.e <updates/>EOF to client. This thread wakes up for every 5 minute InputThread : Inner class (Thread) which is used to read from InputStream of client's socket. CheckTcpSocketTimer : It itereates through tcpSocketInfoList,at every minute. For each iterated TcpSocketInfo, it checks Timer and if timer founds > 60, it closes the session

ovoid createServerSocket()
Creates new TcpIp Server Socket. It also accept client socket connection. For each and every accepted client socket connection, it takes InputStream, Creates new InputThread instance by passing this InputStream and starts that created Thread.

o TcpIpServer(int portNo)
Default constructor

It registers itself as a static member of CommonUtilities so that anyone can access it by calling CommonUtilities.tcpIpServer. Also it starts new TcpIPEmptyUpdates thread for sending empty updates. @see TcpIpEmptyUpdates and CheckTcpSocketTimer thread to check timeout time for each socket. @see CheckTcpSocketTimer

Parameters:
portNo - Integer Value of port Number

o TcpIpServer(string n)
Basic constructor
Parameters:
n - String Value of connection number

oint run()
Starts the thread for TCP - IP Server


This class has no child classes.
Author:
Parikshit Thakur & Team, Trace R&D Center
Version:
Revision: 1.0

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.