OpendTect
6.6
|
Public Types | |
enum | ReadStatus { ReadOK , Timeout , ReadError } |
Public Member Functions | |
Socket (bool islocal, bool haveeventloop=true) | |
Socket (QLocalSocket *, bool haveeventloop=true) | |
Socket (QTcpSocket *, bool haveeventloop=true) | |
~Socket () | |
void | abort () |
Just stops all pending operations. More... | |
od_int64 | bytesAvailable () const |
bool | connectToHost (const Authority &, bool wait=true) |
bool | disconnectFromHost (bool wait=false) |
uiString | errMsg () const |
bool | isBad () const |
bool | isConnected () const |
bool | isLocal () const |
QObject * | qSocket () |
bool | read (BufferString &) const |
bool | read (IOPar &) const |
ReadStatus | read (Network::RequestPacket &) const |
ReadStatus | readArray (void *, od_int64) const |
bool | readChar (char &) const |
bool | readDouble (double &) const |
bool | readDoubleArray (double *, od_int64) const |
bool | readFloat (float &) const |
bool | readFloatArray (float *, od_int64) const |
bool | readInt32 (od_int32 &) const |
bool | readInt32Array (od_int32 *, od_int64) const |
bool | readInt64 (od_int64 &) const |
bool | readInt64Array (od_int64 *, od_int64) const |
bool | readShort (short &) const |
bool | readShortArray (short *, od_int64) const |
void | setTimeout (int ms) |
Threads::ThreadID | thread () const |
bool | write (const IOPar &) |
bool | write (const Network::RequestPacket &, bool wait=false) |
bool | write (const OD::String &) |
bool | writeArray (const void *, od_int64, bool wait=false) |
bool | writeChar (char) |
bool | writeDouble (double) |
bool | writeDoubleArray (const double *, od_int64, bool wait=false) |
bool | writeFloat (float) |
bool | writeFloatArray (const float *, od_int64, bool wait=false) |
bool | writeInt32 (od_int32) |
bool | writeInt32Array (const od_int32 *, od_int64, bool wait=false) |
bool | writeInt64 (od_int64) |
bool | writeInt64Array (const od_int64 *, od_int64, bool wait=false) |
bool | writeShort (short) |
bool | writeShortArray (const short *, od_int64, bool wait=false) |
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 |
Static Public Member Functions | |
static const char * | sKeyLocalHost () |
Static Public Member Functions inherited from CallBacker | |
static void | createReceiverForCurrentThread () |
static void | removeReceiverForCurrentThread () |
Public Attributes | |
Notifier< Socket > | disconnected |
usually remote host terminates. More... | |
Notifier< Socket > | error |
Notifier< Socket > | readyRead |
Private Member Functions | |
QString | getSocketErrMsg () const |
uiString | noConnErrMsg () const |
uiString | readErrMsg () const |
bool | waitForConnected () const |
bool | waitForNewData () const |
bool | waitForWrite (bool all) const |
Private Attributes | |
uiString | errmsg_ |
Threads::Lock | lock_ |
bool | noeventloop_ |
bool | ownssocket_ |
QLocalSocket * | qlocalsocket_ = nullptr |
QTcpSocket * | qtcpsocket_ = nullptr |
QTcpSocketComm * | socketcomm_ |
const Threads::ThreadID | thread_ |
int | timeout_ = 30000 |
Enables the connection and sending of binary and text data through a socket both with and without event-loops.
After construction, you need to connect to a host on a port. If you choose not to wait then (dis-)connecting only fails if it is already in progress.
Strings are transferred without trailing '\0', but with a leading integer for the size.
<>
Network::Socket::Socket | ( | bool | islocal, |
bool | haveeventloop = true |
||
) |
|
explicit |
|
explicit |
Network::Socket::~Socket | ( | ) |
void Network::Socket::abort | ( | ) |
Just stops all pending operations.
od_int64 Network::Socket::bytesAvailable | ( | ) | const |
bool Network::Socket::connectToHost | ( | const Authority & | , |
bool | wait = true |
||
) |
bool Network::Socket::disconnectFromHost | ( | bool | wait = false | ) |
|
inline |
|
private |
bool Network::Socket::isBad | ( | ) | const |
bool Network::Socket::isConnected | ( | ) | const |
|
inline |
|
private |
QObject* Network::Socket::qSocket | ( | ) |
bool Network::Socket::read | ( | BufferString & | ) | const |
bool Network::Socket::read | ( | IOPar & | ) | const |
ReadStatus Network::Socket::read | ( | Network::RequestPacket & | ) | const |
ReadStatus Network::Socket::readArray | ( | void * | , |
od_int64 | |||
) | const |
bool Network::Socket::readChar | ( | char & | ) | const |
bool Network::Socket::readDouble | ( | double & | ) | const |
bool Network::Socket::readDoubleArray | ( | double * | , |
od_int64 | |||
) | const |
|
private |
bool Network::Socket::readFloat | ( | float & | ) | const |
bool Network::Socket::readFloatArray | ( | float * | , |
od_int64 | |||
) | const |
bool Network::Socket::readInt32 | ( | od_int32 & | ) | const |
bool Network::Socket::readInt32Array | ( | od_int32 * | , |
od_int64 | |||
) | const |
bool Network::Socket::readInt64 | ( | od_int64 & | ) | const |
bool Network::Socket::readInt64Array | ( | od_int64 * | , |
od_int64 | |||
) | const |
bool Network::Socket::readShort | ( | short & | ) | const |
bool Network::Socket::readShortArray | ( | short * | , |
od_int64 | |||
) | const |
|
inline |
|
inlinestatic |
|
inline |
|
private |
|
private |
|
private |
bool Network::Socket::write | ( | const IOPar & | ) |
bool Network::Socket::write | ( | const Network::RequestPacket & | , |
bool | wait = false |
||
) |
bool Network::Socket::write | ( | const OD::String & | ) |
bool Network::Socket::writeArray | ( | const void * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
bool Network::Socket::writeChar | ( | char | ) |
bool Network::Socket::writeDouble | ( | double | ) |
bool Network::Socket::writeDoubleArray | ( | const double * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
bool Network::Socket::writeFloat | ( | float | ) |
bool Network::Socket::writeFloatArray | ( | const float * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
bool Network::Socket::writeInt32 | ( | od_int32 | ) |
bool Network::Socket::writeInt32Array | ( | const od_int32 * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
bool Network::Socket::writeInt64 | ( | od_int64 | ) |
bool Network::Socket::writeInt64Array | ( | const od_int64 * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
bool Network::Socket::writeShort | ( | short | ) |
bool Network::Socket::writeShortArray | ( | const short * | , |
od_int64 | , | ||
bool | wait = false |
||
) |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
Note that object may or may not be locked, so you may not be able to read immediately
|
private |
|
private |
|
private |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022