34#ifndef _QORE_CLASS_SOCKET_H
36#define _QORE_CLASS_SOCKET_H
45#include <qore/QoreSocket.h>
46#include <qore/AbstractPrivateData.h>
47#include <qore/QoreThreadLock.h>
48#include <qore/QoreSocketObject.h>
49#include "qore/intern/QC_SSLCertificate.h"
50#include "qore/intern/QC_SSLPrivateKey.h"
58 bool in_non_block =
false;
62 : socket(s), cert(c), pk(p) {
65 DLLLOCAL my_socket_priv() : socket(new
QoreSocket) {
68 DLLLOCAL ~my_socket_priv() {
80 DLLLOCAL
void invalidate() {
95 xsink->
raiseException(
"OBJECT-ALREADY-DELETED",
"the underlying socket object has already been deleted "
96 "and can no longer be used");
108 xsink->
raiseException(
"SOCKET-NON-BLOCK-ERROR",
"a non-blocking operation is currently in progress");
112 return checkValid(xsink);
122 DLLLOCAL
void setNonBlock() {
126 assert(!in_non_block);
135 if (!checkNonBlock(xsink)) {
143 DLLLOCAL
void clearNonBlock() {
147 in_non_block =
false;
156 DLLLOCAL
static void setAccept(QoreSocketObject& sock,
QoreObject* o) {
157 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:50
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:310
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:61
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:129
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:85