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

Public Member Functions

 RequestConnection (const Authority &, bool multithreaded=true, int connectiontimeout=-1)
 Initiates communications. More...
 
 RequestConnection (Socket *)
 
 ~RequestConnection ()
 
uiString errMsg () const
 
RefMan< RequestPacketgetNextExternalPacket ()
 
int ID () const
 
bool isMultiThreaded ()
 
bool isOK () const
 is the conn usable? More...
 
RefMan< RequestPacketpickupPacket (od_int32 reqid, int timeout, int *errorcode=nullptr)
 
PortNr_Type port () const
 
bool sendPacket (const RequestPacket &, bool waitforfinish=false)
 
BufferString server () const
 
Socketsocket ()
 
bool stillTrying () const
 if not OK, may it become? More...
 
- 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 int cDisconnected ()
 
static int cInvalidRequest ()
 
static int cTimeout ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Public Attributes

Notifier< RequestConnectionconnectionClosed
 
CNotifier< RequestConnection, od_int32 > packetArrived
 

Private Member Functions

void connCloseCB (CallBacker *)
 
void connectToHost (bool witheventloop)
 
void dataArrivedCB (CallBacker *)
 
bool doSendPacket (const RequestPacket &, bool waitforfinish)
 
RefMan< RequestPacketgetNextAlreadyRead (int)
 
void newConnectionCB (CallBacker *)
 
bool readFromSocket ()
 
void requestEnded (od_int32)
 
void sendQueueCB (CallBacker *)
 
void socketThreadFunc (CallBacker *)
 
bool writeToSocket ()
 

Private Attributes

Authorityauthority_ = nullptr
 
uiString errmsg_
 
QEventLoop * eventloop_ = nullptr
 
Threads::ConditionVareventlooplock_ = nullptr
 
int id_
 
Threads::ConditionVar lock_
 
TypeSet< od_int32 > ourrequestids_
 
bool ownssocket_
 
ObjectSet< RequestPacketreceivedpackets_
 
ObjectSet< PacketSendDatasendqueue_
 
Socketsocket_
 
Threads::Threadsocketthread_ = nullptr
 
int timeout_
 

Friends

struct PacketSendData
 
class RequestConnectionSender
 

Detailed Description

<>

Constructor & Destructor Documentation

◆ RequestConnection() [1/2]

Network::RequestConnection::RequestConnection ( const Authority ,
bool  multithreaded = true,
int  connectiontimeout = -1 
)

Initiates communications.

◆ RequestConnection() [2/2]

Network::RequestConnection::RequestConnection ( Socket )

Socket does NOT become mine. Socket should be connected to whomever is my counterpart.

◆ ~RequestConnection()

Network::RequestConnection::~RequestConnection ( )

Member Function Documentation

◆ cDisconnected()

static int Network::RequestConnection::cDisconnected ( )
inlinestatic

◆ cInvalidRequest()

static int Network::RequestConnection::cInvalidRequest ( )
inlinestatic

◆ connCloseCB()

void Network::RequestConnection::connCloseCB ( CallBacker )
private

◆ connectToHost()

void Network::RequestConnection::connectToHost ( bool  witheventloop)
private

◆ cTimeout()

static int Network::RequestConnection::cTimeout ( )
inlinestatic

◆ dataArrivedCB()

void Network::RequestConnection::dataArrivedCB ( CallBacker )
private

◆ doSendPacket()

bool Network::RequestConnection::doSendPacket ( const RequestPacket ,
bool  waitforfinish 
)
private

◆ errMsg()

uiString Network::RequestConnection::errMsg ( ) const
inline

◆ getNextAlreadyRead()

RefMan<RequestPacket> Network::RequestConnection::getNextAlreadyRead ( int  )
private

◆ getNextExternalPacket()

RefMan<RequestPacket> Network::RequestConnection::getNextExternalPacket ( )

◆ ID()

int Network::RequestConnection::ID ( ) const
inline

◆ isMultiThreaded()

bool Network::RequestConnection::isMultiThreaded ( )
inline

◆ isOK()

bool Network::RequestConnection::isOK ( ) const

is the conn usable?

◆ newConnectionCB()

void Network::RequestConnection::newConnectionCB ( CallBacker )
private

◆ pickupPacket()

RefMan<RequestPacket> Network::RequestConnection::pickupPacket ( od_int32  reqid,
int  timeout,
int *  errorcode = nullptr 
)

Must be called from same thread as construcor unless 'multithreaded' flag was set on constructor.

◆ port()

PortNr_Type Network::RequestConnection::port ( ) const

◆ readFromSocket()

bool Network::RequestConnection::readFromSocket ( )
private

◆ requestEnded()

void Network::RequestConnection::requestEnded ( od_int32  )
private

◆ sendPacket()

bool Network::RequestConnection::sendPacket ( const RequestPacket ,
bool  waitforfinish = false 
)

Must be called from same thread as construcor unless 'multithreaded' flag was set on constructor.

◆ sendQueueCB()

void Network::RequestConnection::sendQueueCB ( CallBacker )
private

◆ server()

BufferString Network::RequestConnection::server ( ) const

◆ socket()

Socket* Network::RequestConnection::socket ( )
inline

◆ socketThreadFunc()

void Network::RequestConnection::socketThreadFunc ( CallBacker )
private

◆ stillTrying()

bool Network::RequestConnection::stillTrying ( ) const

if not OK, may it become?

◆ writeToSocket()

bool Network::RequestConnection::writeToSocket ( )
private

Friends And Related Function Documentation

◆ PacketSendData

friend struct PacketSendData
friend

◆ RequestConnectionSender

friend class RequestConnectionSender
friend

Member Data Documentation

◆ authority_

Authority* Network::RequestConnection::authority_ = nullptr
private

◆ connectionClosed

Notifier<RequestConnection> Network::RequestConnection::connectionClosed

◆ errmsg_

uiString Network::RequestConnection::errmsg_
mutableprivate

◆ eventloop_

QEventLoop* Network::RequestConnection::eventloop_ = nullptr
private

◆ eventlooplock_

Threads::ConditionVar* Network::RequestConnection::eventlooplock_ = nullptr
private

◆ id_

int Network::RequestConnection::id_
private

◆ lock_

Threads::ConditionVar Network::RequestConnection::lock_
private

◆ ourrequestids_

TypeSet<od_int32> Network::RequestConnection::ourrequestids_
private

◆ ownssocket_

bool Network::RequestConnection::ownssocket_
private

◆ packetArrived

CNotifier<RequestConnection,od_int32> Network::RequestConnection::packetArrived

◆ receivedpackets_

ObjectSet<RequestPacket> Network::RequestConnection::receivedpackets_
private

◆ sendqueue_

ObjectSet<PacketSendData> Network::RequestConnection::sendqueue_
private

◆ socket_

Socket* Network::RequestConnection::socket_
private

◆ socketthread_

Threads::Thread* Network::RequestConnection::socketthread_ = nullptr
private

◆ timeout_

int Network::RequestConnection::timeout_
private

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