34 #ifndef _QORE_CLASS_SOCKET_H
36 #define _QORE_CLASS_SOCKET_H
44 #include <qore/QoreSocket.h>
45 #include <qore/AbstractPrivateData.h>
46 #include <qore/QoreThreadLock.h>
47 #include <qore/QoreSocketObject.h>
48 #include "qore/intern/QC_SSLCertificate.h"
49 #include "qore/intern/QC_SSLPrivateKey.h"
51 class my_socket_priv {
57 bool in_non_block =
false;
61 : socket(s), cert(c), pk(p) {
64 DLLLOCAL my_socket_priv() : socket(new
QoreSocket) {
67 DLLLOCAL ~my_socket_priv() {
79 DLLLOCAL
void invalidate() {
94 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"the underlying socket object has already been deleted "
95 "and can no longer be used");
107 xsink->
raiseException(
"SOCKET-NON-BLOCK-ERROR",
"a non-blocking operation is currently in progress");
111 return checkValid(xsink);
121 DLLLOCAL
void setNonBlock() {
125 assert(!in_non_block);
134 if (!checkNonBlock(xsink)) {
142 DLLLOCAL
void clearNonBlock() {
146 in_non_block =
false;
155 DLLLOCAL
static void setAccept(QoreSocketObject& sock,
QoreObject* o) {
156 sock.priv->setAccept(o);
virtual DLLLOCAL void deref(ExceptionSink *xsink)
decrements the reference count of the object
Definition: AbstractPrivateData.h:59
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT AbstractQoreNode * raiseException(const char *err, const char *fmt,...)
appends a Qore-language exception to the list
defines a Qore-language class
Definition: QoreClass.h:249
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:65
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition: QoreObject.h:60
represents an X509 certificate, reference-counted, dynamically-allocated only
Definition: QoreSSLCertificate.h:42
provides access to a private key data structure for SSL connections
Definition: QoreSSLPrivateKey.h:40
provides access to sockets using Qore data structures
Definition: QoreSocket.h:127
DLLLOCAL void setAccept(QoreObject *o)
sets backwards-compatible members on accept in a new object - will be removed in a future version of ...
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:49
DLLLOCAL int trylock()
attempts to acquire the mutex and returns the status immediately; does not block
Definition: QoreThreadLock.h:101
typed hash declaration
Definition: TypedHashDecl.h:44
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:79