OpendTect  7.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Network::Server Class Reference
Inheritance diagram for Network::Server:
[legend]

Public Member Functions

 Server (bool islocal)
 
 ~Server ()
 
Authority authority () const
 
void close ()
 
const char * errorMsg () const
 
SocketgetSocket (int id)
 
const SocketgetSocket (int id) const
 
bool hasPendingConnections () const
 
bool isListening () const
 
bool isLocal () const
 
bool listen (const char *servernm, uiRetVal &)
 
bool listen (SpecAddr=Any, PortNr_Type port=0)
 If Any, server will listen to all network interfaces. More...
 
QTcpSocket * nextPendingConnection ()
 Use when you want to access Qt object directly. More...
 
QLocalSocket * nextPendingLocalConnection ()
 
PortNr_Type port () const
 
void read (int id, BufferString &) const
 
void read (int id, IOPar &) const
 
bool waitForNewConnection (int msec)
 
int write (int id, const char *)
 Writes to next pending socket. More...
 
int write (int id, const IOPar &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 

Static Public Member Functions

static const char * sKeyHostName ()
 
static const char * sKeyKillword ()
 
static const char * sKeyLocal ()
 
static const char * sKeyNoListen ()
 
static const char * sKeyPort ()
 
static const char * sKeyTimeout ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Public Attributes

CNotifier< Server, int > newConnection
 
CNotifier< Server, int > readyRead
 

Protected Member Functions

void disconnectCB (CallBacker *)
 
void notifyNewConnection ()
 
void readyReadCB (CallBacker *)
 

Protected Attributes

QTcpServerCommcomm_
 
BufferString errmsg_
 
TypeSet< int > ids_
 
QLocalServer * qlocalserver_ = nullptr
 
QTcpServer * qtcpserver_ = nullptr
 
ObjectSet< Socketsockets2bdeleted_
 
ObjectSet< Socketsockets_
 

Friends

class QTcpServerComm
 

Detailed Description

<>

Constructor & Destructor Documentation

◆ Server()

Network::Server::Server ( bool  islocal)

◆ ~Server()

Network::Server::~Server ( )

Member Function Documentation

◆ authority()

Authority Network::Server::authority ( ) const

◆ close()

void Network::Server::close ( )

◆ disconnectCB()

void Network::Server::disconnectCB ( CallBacker )
protected

◆ errorMsg()

const char* Network::Server::errorMsg ( ) const

◆ getSocket() [1/2]

Socket* Network::Server::getSocket ( int  id)

◆ getSocket() [2/2]

const Socket* Network::Server::getSocket ( int  id) const

◆ hasPendingConnections()

bool Network::Server::hasPendingConnections ( ) const

◆ isListening()

bool Network::Server::isListening ( ) const

◆ isLocal()

bool Network::Server::isLocal ( ) const
inline

◆ listen() [1/2]

bool Network::Server::listen ( const char *  servernm,
uiRetVal  
)

◆ listen() [2/2]

bool Network::Server::listen ( SpecAddr  = Any,
PortNr_Type  port = 0 
)

If Any, server will listen to all network interfaces.

◆ nextPendingConnection()

QTcpSocket* Network::Server::nextPendingConnection ( )

Use when you want to access Qt object directly.

◆ nextPendingLocalConnection()

QLocalSocket* Network::Server::nextPendingLocalConnection ( )

◆ notifyNewConnection()

void Network::Server::notifyNewConnection ( )
protected

◆ port()

PortNr_Type Network::Server::port ( ) const

◆ read() [1/2]

void Network::Server::read ( int  id,
BufferString  
) const

◆ read() [2/2]

void Network::Server::read ( int  id,
IOPar  
) const

◆ readyReadCB()

void Network::Server::readyReadCB ( CallBacker )
protected

◆ sKeyHostName()

static const char* Network::Server::sKeyHostName ( )
inlinestatic

◆ sKeyKillword()

static const char* Network::Server::sKeyKillword ( )
inlinestatic

◆ sKeyLocal()

static const char* Network::Server::sKeyLocal ( )
inlinestatic

◆ sKeyNoListen()

static const char* Network::Server::sKeyNoListen ( )
inlinestatic

◆ sKeyPort()

static const char* Network::Server::sKeyPort ( )
inlinestatic

◆ sKeyTimeout()

static const char* Network::Server::sKeyTimeout ( )
inlinestatic

◆ waitForNewConnection()

bool Network::Server::waitForNewConnection ( int  msec)

Useful when no event loop available If msec is -1, this function will not time out

◆ write() [1/2]

int Network::Server::write ( int  id,
const char *   
)

Writes to next pending socket.

◆ write() [2/2]

int Network::Server::write ( int  id,
const IOPar  
)

Friends And Related Function Documentation

◆ QTcpServerComm

friend class QTcpServerComm
friend

Member Data Documentation

◆ comm_

QTcpServerComm* Network::Server::comm_
protected

◆ errmsg_

BufferString Network::Server::errmsg_
mutableprotected

◆ ids_

TypeSet<int> Network::Server::ids_
protected

◆ newConnection

CNotifier<Server,int> Network::Server::newConnection

◆ qlocalserver_

QLocalServer* Network::Server::qlocalserver_ = nullptr
protected

◆ qtcpserver_

QTcpServer* Network::Server::qtcpserver_ = nullptr
protected

◆ readyRead

CNotifier<Server,int> Network::Server::readyRead

◆ sockets2bdeleted_

ObjectSet<Socket> Network::Server::sockets2bdeleted_
protected

◆ sockets_

ObjectSet<Socket> Network::Server::sockets_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024