 |
Qore Programming Language Reference Manual
0.9.4.1
|
243 int bind(
string str, softbool reuseaddr =
False);
261 int bind(
int port, softbool reuseaddr =
False);
293 nothing
bindINET(*
string iface, *softstring service, softbool reuseaddr =
False, softint family =
AF_UNSPEC, softint socktype =
SOCK_STREAM, softint protocol = 0);
402 nothing
connect(
string target, timeout timeout_ms = -1);
430 nothing
connectINET(
string host, softstring service, timeout timeout_ms = -1, softint family =
AF_UNSPEC, softint socktype =
SOCK_STREAM, softint protocol = 0);
491 nothing
connectSSL(
string target, timeout timeout_ms = -1);
892 int listen(
int backlog = 20);
1094 hash<auto>
readHTTPHeader(timeout timeout_ms = -1, *reference<hash<auto>> info);
1150 string recv(softint size = 0, timeout timeout_ms = -1);
1230 int recvi1(timeout timeout_ms = -1);
1256 int recvi2(timeout timeout_ms = -1);
1308 int recvi4(timeout timeout_ms = -1);
1360 int recvi8(timeout timeout_ms = -1);
1412 int recvu1(timeout timeout_ms = -1);
1438 int recvu2(timeout timeout_ms = -1);
1490 int recvu4(timeout timeout_ms = -1);
1546 int send(
binary bin, timeout timeout_ms = -1);
1578 int send(
string str, timeout timeout_ms = -1);
1605 nothing
send2(
binary bin, timeout timeout_ms = -1);
1634 nothing
send2(
string str, timeout timeout_ms = -1);
1663 int sendBinary(
string str, timeout timeout_ms = -1);
1718 nothing
sendBinary2(
string str, timeout timeout_ms = -1);
1870 nothing
sendHTTPMessage(
string method,
string path,
string http_version, hash<auto> headers,
string body, *reference<hash> info, timeout timeout_ms = -1);
1906 nothing
sendHTTPMessage(
string method,
string path,
string http_version, hash<auto> headers, *
binary body, *reference<hash<auto>> info, timeout timeout_ms = -1);
1938 nothing
sendHTTPMessageWithCallback(code scb,
string method,
string path,
string http_version, hash<auto> headers, *reference<hash<auto>> info, timeout timeout_ms = -1);
1966 nothing
sendHTTPResponse(softint status_code,
string status_desc,
string http_version, hash<auto> headers,
string body, timeout timeout_ms = -1);
2008 nothing
sendHTTPResponse(softint status_code,
string status_desc,
string http_version, hash<auto> headers,
string body, *reference<hash<auto>> info, timeout timeout_ms = -1);
2041 nothing
sendHTTPResponse(softint status_code,
string status_desc,
string http_version, hash<auto> headers, *
binary body, timeout timeout_ms = -1);
2079 nothing
sendHTTPResponse(softint status_code,
string status_desc,
string http_version, hash<auto> headers, *
binary body, *reference<hash<auto>> info, timeout timeout_ms = -1);
2125 nothing
sendHTTPResponse(softint status_code,
string status_desc,
string http_version, hash<auto> headers,
Qore::InputStream input_stream,
int max_chunk_size = 4096, *reference<hash<auto>> info, timeout timeout_ms = -1, *code tcb);
2164 nothing
sendHTTPResponseWithCallback(code scb, softint status_code,
string status_desc,
string http_version, hash<auto> headers, timeout timeout_ms = -1);
2206 nothing
sendHTTPResponseWithCallback(code scb, softint status_code,
string status_desc,
string http_version, hash<auto> headers, *reference<hash<auto>> info, timeout timeout_ms = -1);
2233 int sendi1(softint i = 0, timeout timeout_ms = -1);
2260 int sendi2(softint i = 0, timeout timeout_ms = -1);
2287 int sendi2LSB(softint i = 0, timeout timeout_ms = -1);
2314 int sendi4(softint i = 0, timeout timeout_ms = -1);
2341 int sendi4LSB(softint i = 0, timeout timeout_ms = -1);
2368 int sendi8(softint i = 0, timeout timeout_ms = -1);
2395 int sendi8LSB(softint i = 0, timeout timeout_ms = -1);
2617 nothing
setWarningQueue(
int warning_ms,
int warning_bs, Queue queue,
auto arg, timeout min_ms = 1s);
2830 "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT":
"Unable to get issuer certificate",
2831 "X509_V_ERR_UNABLE_TO_GET_CRL":
"Unable to get certificate CRL",
2832 "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE":
"Unable to decrypt certificate's signature. This means that the actual signature value could not be determined rather than it not matching the expected value; this is only meaningful for RSA",
2833 "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE":
"Unable to decrypt CRL's signature",
2834 "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY":
"Unable to decode issuer public key (SubjectPublicKeyInfo)",
2835 "X509_V_ERR_CERT_SIGNATURE_FAILURE":
"Certificate signature failure; the signature of the certificate is invalid",
2836 "X509_V_ERR_CRL_SIGNATURE_FAILURE":
"CRL signature failure; the signature of the certificate is invalid",
2837 "X509_V_ERR_CERT_NOT_YET_VALID":
"Certificate is not yet valid",
2838 "X509_V_ERR_CERT_HAS_EXPIRED":
"Certificate has expired",
2839 "X509_V_ERR_CRL_NOT_YET_VALID":
"CRL is not yet valid",
2840 "X509_V_ERR_CRL_HAS_EXPIRED":
"CRL has expired",
2841 "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD":
"Format error in certificate's notBefore field (invalid time)",
2842 "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD":
"Format error in certificate's notAfter field (invalid time)",
2843 "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD":
"Format error in CRL's lastUpdate field (invalid time)",
2844 "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD":
"Format error in CRL's nextUpdate field (invalid time)",
2845 "X509_V_ERR_OUT_OF_MEM":
"Out of memory error",
2846 "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT":
"Certificate is self-signed and cannot be found in the trusted list",
2847 "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN":
"Self signed certificate in certificate chain",
2848 "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY":
"Unable to get local issuer certificate. This normally means the list of trusted certificates is not complete",
2849 "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE":
"Unable to verify the first certificate",
2850 "X509_V_ERR_CERT_CHAIN_TOO_LONG":
"Certificate chain too long",
2851 "X509_V_ERR_CERT_REVOKED":
"Certificate has been revoked",
2852 "X509_V_ERR_INVALID_CA":
"Invalid CA certificate",
2853 "X509_V_ERR_PATH_LENGTH_EXCEEDED":
"The basicConstraints pathlength parameter has been exceeded",
2854 "X509_V_ERR_INVALID_PURPOSE":
"The certificate cannot be used for the specified purpose",
2855 "X509_V_ERR_CERT_UNTRUSTED":
"Root CA is not marked as trusted for the specified purpose",
2856 "X509_V_ERR_CERT_REJECTED":
"Root CA is marked to reject the specified purpose",
2857 "X509_V_ERR_SUBJECT_ISSUER_MISMATCH":
"The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate",
2858 "X509_V_ERR_AKID_SKID_MISMATCH":
"The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier of the current certificate",
2859 "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH":
"Issuer name and serial number of candidate certificate do not match the authority key identifier of the current certificate",
2860 "X509_V_ERR_KEYUSAGE_NO_CERTSIGN":
"The keyUsage extension does not permit certificate signing",
2861 "X509_V_ERR_APPLICATION_VERIFICATION":
"Verification failure",
2869 const AFMap = qore(get_network_address_family_map());
const X509_VerificationReasons
maps from varification strings to verification code descriptions
Definition: QC_Socket.dox.h:2828
nothing bindUNIX(string path, softint socktype=SOCK_STREAM, softint protocol=0)
Opens and binds the socket to the given UNIX domain socket file as given by the filename argument....
int recvu2LSB(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) unsigned integer in little-endian format from the socket.
string getCharset()
Returns the character encoding for the socket.
const X509_V_ERR_UNABLE_TO_GET_CRL
Unable to get certificate CRL.
Definition: QC_Socket.dox.h:2818
const AFMap
mapping from Network Address Family Constants to string codes
Definition: QC_Socket.dox.h:2870
int recvu4LSB(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) unsigned integer in little-endian format from the socket.
bool isSecure()
Returns True if the connection is a secure TLS/SSL connection.
const X509_V_ERR_CRL_SIGNATURE_FAILURE
CRL signature failure; the signature of the certificate is invalid.
Definition: QC_Socket.dox.h:2786
int recvi2LSB(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) signed integer in little-endian format from the socket.
const SSL_VERIFY_NONE
Do not verify the peer's certificate.
Definition: QC_Socket.dox.h:2734
int recvu1(timeout timeout_ms=-1)
Receives a 1-byte unsigned integer from the socket.
int recvi8LSB(timeout timeout_ms=-1)
Receives an 8-byte (64-bit) signed integer in little-endian format from the socket.
nothing sendHTTPChunkedBodyTrailer(*hash< auto > trailer, timeout timeout_ms=-1)
Sends the trialer of an HTTP message body in chunked transfer encoding.
hash< auto > readHTTPChunkedBody(timeout timeout_ms=-1)
Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers recei...
const X509_V_ERR_AKID_SKID_MISMATCH
The current candidate issuer certificate was rejected because its subject key identifier was present ...
Definition: QC_Socket.dox.h:2764
Socket acceptSSL()
Accepts connections on a listening socket and attempts to negotiate a TLS/SSL connection.
bool isDataAvailable(timeout timeout_ms=0)
Returns True or False depending on whether there is data to be read on the socket.
int sendi4(softint i=0, timeout timeout_ms=-1)
Sends a 4-byte (32-bit) integer in big-endian format (network byte order) over the socket.
hash< auto > getUsageInfo()
Returns performance statistics for the socket.
const X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
Unable to decode issuer public key (SubjectPublicKeyInfo)
Definition: QC_Socket.dox.h:2812
const X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH
Issuer name and serial number of candidate certificate do not match the authority key identifier of t...
Definition: QC_Socket.dox.h:2762
string getEncoding()
Returns the character encoding for the socket.
const SOCK_STREAM
for sequenced, reliable, two-way connection-based byte streams (the default)
Definition: QC_Socket.dox.h:2942
nothing sendHTTPMessage(string method, string path, string http_version, hash< auto > headers, string body, *reference< hash > info, timeout timeout_ms=-1)
Sends an HTTP message with a method and user-defined headers given as a hash and an optional message ...
const X509_V_ERR_KEYUSAGE_NO_CERTSIGN
The keyUsage extension does not permit certificate signing.
Definition: QC_Socket.dox.h:2802
int sendi2LSB(softint i=0, timeout timeout_ms=-1)
Sends a 2-byte (16-bit) integer in little-endian format over the socket.
const SOCK_RAW
raw socket interface, only available to the superuser, untested
Definition: QC_Socket.dox.h:2940
nothing connectINETSSL(string host, softstring service, timeout timeout_ms=-1, softint family=AF_UNSPEC, softint socktype=SOCK_STREAM, softint protocol=0)
Connects to the given host and port and attempts to establish a TLS/SSL connection; accepts an option...
readHTTPChunkedBodyWithCallback(code rcb, timeout timeout_ms=-1)
Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers recei...
int sendi8(softint i=0, timeout timeout_ms=-1)
Sends an 8-byte (64-bit) integer in big-endian format (network byte order) over the socket.
acceptAllCertificates(bool accept_all=True)
with peer verification enabled, all certificates are accepted regardless of the validity of the Certi...
nothing shutdownSSL()
Shuts down the SSL connection on a secure connection.
int recvi1(timeout timeout_ms=-1)
Receives a 1-byte signed integer from the socket.
const AF_INET6
IPv6 address family.
Definition: QC_Socket.dox.h:2882
const IPPROTO_TCP
for the TCP protocol
Definition: QC_Socket.dox.h:2928
string recv(softint size=0, timeout timeout_ms=-1)
Receives data from the socket and returns a string tagged with the Socket's character encoding.
const X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
Unable to decrypt CRL's signature.
Definition: QC_Socket.dox.h:2816
bool isWriteFinished(timeout timeout_ms=0)
Returns True or False depending on whether all the data has been written to the socket.
int recvi4(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) signed integer in big-endian format (network byte order) from the socket.
const X509_V_ERR_APPLICATION_VERIFICATION
Verification failure.
Definition: QC_Socket.dox.h:2766
hash< auto > readHTTPHeader(timeout timeout_ms=-1, *reference< hash< auto >> info)
Retuns a hash representing the data in the HTTP header read, or, if the data cannot be parsed as an H...
nothing connect(string target, timeout timeout_ms=-1)
Connects to a remote port (if the string has a format "host:port") or UNIX domain socket file with an...
const X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
Format error in CRL's nextUpdate field (invalid time)
Definition: QC_Socket.dox.h:2796
nothing bindINET(*string iface, *softstring service, softbool reuseaddr=False, softint family=AF_UNSPEC, softint socktype=SOCK_STREAM, softint protocol=0)
Opens and binds the socket to the given IPv4 or IPv6 interface (or if no interface is given,...
const AFStrMap
mapping from network address family string codes to Network Address Family Constants
Definition: QC_Socket.dox.h:2872
nothing setPrivateKey(SSLPrivateKey key)
Sets the private key to use for negotiating encrypted connections along with the X....
const X509_V_ERR_PATH_LENGTH_EXCEEDED
The basicConstraints pathlength parameter has been exceeded.
Definition: QC_Socket.dox.h:2806
const X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
Certificate is self-signed and cannot be found in the trusted list.
Definition: QC_Socket.dox.h:2788
const IPPROTO_UDP
for the UDP protocol
Definition: QC_Socket.dox.h:2930
bool pendingHttpChunkedBody()
returns True if the socket is still connected, and a HTTP header was read indicating chunked transfer...
const True
logical True
Definition: qc_qore.dox.h:98
const X509_V_ERR_CERT_UNTRUSTED
Root CA is not marked as trusted for the specified purpose.
Definition: QC_Socket.dox.h:2780
bool isOpen()
Returns True if the socket is open.
int sendi4LSB(softint i=0, timeout timeout_ms=-1)
Sends a 4-byte (32-bit) integer in little-endian format over the socket.
*SSLCertificate getRemoteCertificate()
Returns any remote certificate captured or NOTHING if there is none.
nothing upgradeServerToSSL(timeout timeout_ms=-1)
Upgrades a server socket connection to a TLS/SSL connection.
const X509_V_ERR_CERT_SIGNATURE_FAILURE
Certificate signature failure; the signature of the certificate is invalid.
Definition: QC_Socket.dox.h:2778
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition: QC_Queue.dox.h:17
int send(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
int getSendTimeout()
Returns the send timeout socket option value as an integer in milliseconds.
int getSocket()
Returns the socket file descriptor number.
const X509_V_ERR_CERT_HAS_EXPIRED
Certificate has expired.
Definition: QC_Socket.dox.h:2770
string readHTTPHeaderString(timeout timeout_ms=-1)
Retuns a string representing the data in the HTTP header read (reads until "\r\n\r\n")
const X509_V_ERR_INVALID_CA
Invalid CA certificate.
Definition: QC_Socket.dox.h:2798
const X509_V_ERR_CERT_REVOKED
Certificate has been revoked.
Definition: QC_Socket.dox.h:2776
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
setSslVerifyMode(int mode)
sets the SSL verification mode
nothing recvToOutputStream(Qore::OutputStream os, softint size=-1, timeout timeout_ms=-1)
Receives data from the socket and writes the bytes to an OutputStream.
readHTTPChunkedBodyBinaryWithCallback(code rcb, timeout timeout_ms=-1)
Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers recei...
int shutdown()
Ensures that a socket will be closed even if the file descriptor is shared with other processes (for ...
This class defines an abstract interface for output streams.
Definition: QC_OutputStream.dox.h:18
nothing setEncoding(string encoding)
Sets the character encoding for the socket.
bool captureRemoteCertificates(bool set=True)
Sets the flag for capturing remote X.509 certificates; by default no capture of remote certificates i...
bool getAcceptAllCertificates()
returns the current value of the "accept all certificates" flag
binary recvBinary(softint size=0, timeout timeout_ms=-1)
Receives data from the socket and returns a binary object.
*string verifyPeerCertificate()
Returns a string code giving the result of verifying the remote certificate or NOTHING if an encrypte...
const X509_V_ERR_SUBJECT_ISSUER_MISMATCH
The current candidate issuer certificate was rejected because its subject name did not match the issu...
Definition: QC_Socket.dox.h:2810
const AF_LOCAL
POSIX synonym for AF_UNIX.
Definition: QC_Socket.dox.h:2884
nothing upgradeClientToSSL(timeout timeout_ms=-1)
Upgrades a client socket connection to a TLS/SSL connection.
This class implements a container for private key data.
Definition: QC_SSLPrivateKey.dox.h:10
nothing send2(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
copy()
Creates a new Socket object, not based on the source being copied.
int recvi4LSB(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) signed integer in little-endian format from the socket.
int sendi8LSB(softint i=0, timeout timeout_ms=-1)
Sends an 8-byte (64-bit) integer in little-endian format over the socket.
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
const SSL_VERIFY_CLIENT_ONCE
Only request a client certificate once in server mode.
Definition: QC_Socket.dox.h:2713
*string getSSLCipherVersion()
Returns the version string of the cipher for an encrypted connection or NOTHING if a secure connectio...
int setSendTimeout(timeout timeout_ms)
sets the send timeout as a socket option
int sendi2(softint i=0, timeout timeout_ms=-1)
Sends a 2-byte (16-bit) integer in big-endian format (network byte order) over the socket.
const X509_V_ERR_CERT_CHAIN_TOO_LONG
Certificate chain too long.
Definition: QC_Socket.dox.h:2768
int sendBinary(string str, timeout timeout_ms=-1)
Sends string data over the socket without converting the string to the socket's encoding,...
*string getSSLCipherName()
Returns the name of the cipher for an encrypted connection or NOTHING if a secure connection has not ...
int bind(string str, softbool reuseaddr=False)
Opens and binds the socket to a port, interface and port (if the bind_to string has a format "host:po...
int getRecvTimeout()
Returns the receive timeout socket option value as an integer in milliseconds.
const X509_V_OK
Verification OK.
Definition: QC_Socket.dox.h:2826
bool getNoDelay()
Returns the TCP_NODELAY setting for the socket.
int setRecvTimeout(timeout timeout_ms)
sets the receive timeout as a socket option
const X509_V_ERR_CERT_REJECTED
Root CA is marked to reject the specified purpose.
Definition: QC_Socket.dox.h:2774
const AF_INET
IPv4 address family.
Definition: QC_Socket.dox.h:2880
hash< auto > readHTTPChunkedBodyBinary(timeout timeout_ms=-1)
Reads in an HTTP message body sent in chunked transfer encoding and returns it with any footers recei...
int close()
Closes an open socket.
const X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
Self signed certificate in certificate chain.
Definition: QC_Socket.dox.h:2808
int sendi1(softint i=0, timeout timeout_ms=-1)
Sends a 1-byte integer over the socket.
const X509_V_ERR_CRL_HAS_EXPIRED
CRL has expired.
Definition: QC_Socket.dox.h:2782
nothing setCharset(string encoding)
Sets the character encoding for the socket.
hash< auto > getSocketInfo(bool host_lookup=True)
Returns information about the local socket as a hash.
hash< auto > readHTTPChunkedBodyToOutputStream(Qore::OutputStream os, timeout timeout_ms=-1)
Reads in an HTTP message body sent in chunked transfer encoding, writes it in an OutputStream and ret...
The Socket class allows Qore programs safe access to network sockets.
Definition: QC_Socket.dox.h:123
const X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
Format error in CRL's lastUpdate field (invalid time)
Definition: QC_Socket.dox.h:2794
nothing sendFromInputStream(Qore::InputStream input_stream, softint size=-1, timeout timeout_ms=-1)
Reads data from an InputStream and sends the bytes over the socket.
const X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
Format error in certificate's notBefore field (invalid time)
Definition: QC_Socket.dox.h:2792
const SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Require a client certificate in server mode.
Definition: QC_Socket.dox.h:2725
const X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE
Unable to decrypt certificate's signature. This means that the actual signature value could not be de...
Definition: QC_Socket.dox.h:2814
const False
logical False
Definition: qc_qore.dox.h:96
const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
Unable to get local issuer certificate. This normally means the list of trusted certificates is not c...
Definition: QC_Socket.dox.h:2822
int recvi2(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) signed integer in big-endian format (network byte order) from the socket.
const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
Unable to get issuer certificate.
Definition: QC_Socket.dox.h:2820
int recvu2(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) unsigned integer in big-endian format (network byte order) from the socket...
nothing sendHTTPResponseWithCallback(code scb, softint status_code, string status_desc, string http_version, hash< auto > headers, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and a message body to send with chun...
clearStats()
Clears performance statistics.
int getSslVerifyMode()
returns the current SSL verification mode
int recvu4(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) unsigned integer in big-endian format (network byte order) from the socket...
int setNoDelay(bool nd=True)
Sets the boolean TCP_NODELAY setting for the socket.
const X509_V_ERR_INVALID_PURPOSE
The certificate cannot be used for the specified purpose.
Definition: QC_Socket.dox.h:2800
const X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
Unable to verify the first certificate.
Definition: QC_Socket.dox.h:2824
nothing sendHTTPMessageWithCallback(code scb, string method, string path, string http_version, hash< auto > headers, *reference< hash< auto >> info, timeout timeout_ms=-1)
Sends an HTTP message with a method and user-defined headers given as a hash and an optional message ...
SSLCertificate objects allow Qore code to work with X.509 certificate data.
Definition: QC_SSLCertificate.dox.h:10
int listen(int backlog=20)
Listens for connections on a bound socket; sets the socket in a listening state.
nothing setEventQueue()
Removes any Queue object from the Socket object so that socket events are no longer added to the Queu...
nothing connectINET(string host, softstring service, timeout timeout_ms=-1, softint family=AF_UNSPEC, softint socktype=SOCK_STREAM, softint protocol=0)
Connects to the given host and port with an optional timeout value with a millisecond resolution.
const AF_UNIX
UNIX domain address family (UNIX socket files)
Definition: QC_Socket.dox.h:2886
const X509_V_ERR_OUT_OF_MEM
Out of memory error.
Definition: QC_Socket.dox.h:2804
const SOCK_DGRAM
for datagrams (connectionless, unreliable messages of a fixed (typically small) maximum length
Definition: QC_Socket.dox.h:2938
const X509_V_ERR_CERT_NOT_YET_VALID
Certificate is not yet valid.
Definition: QC_Socket.dox.h:2772
nothing connectSSL(string target, timeout timeout_ms=-1)
Connects to a remote socket and attempts to establish a TLS/SSL connection; accepts an optional timeo...
nothing sendBinary2(string str, timeout timeout_ms=-1)
Sends string data over the socket without converting the string to the socket's encoding,...
nothing connectUNIX(string path, softint socktype=SOCK_STREAM, softint protocol=0)
Connects to a UNIX domain socket file.
const AF_UNSPEC
unspecified address family
Definition: QC_Socket.dox.h:2888
nothing connectUNIXSSL(string path, softint socktype=SOCK_STREAM, softint protocol=0)
Connects to the given UNIX domain socket file and attempts to establish a TLS/SSL connection.
nothing setCertificate(SSLCertificate cert)
Sets the X.509 certificate to use for negotiating encrypted connections.
int recvi8(timeout timeout_ms=-1)
Receives an 8-byte (64-bit) signed integer in big-endian format (network byte order) from the socket.
const X509_V_ERR_CRL_NOT_YET_VALID
CRL is not yet valid.
Definition: QC_Socket.dox.h:2784
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
int getPort()
Returns the port number of the socket for INET sockets.
int getConnectionId()
Returns an integer connection ID that is incremented every time the socket is disconnected.
hash< auto > getPeerInfo(bool host_lookup=True)
Returns a hash of information about the remote end for connected sockets.
const SSL_VERIFY_PEER
Verify the peer's certificate.
Definition: QC_Socket.dox.h:2751
Socket accept()
Accepts connections on a listening socket.
constructor()
Creates the socket object.
nothing sendHTTPChunkedBodyFromInputStream(Qore::InputStream input_stream, int max_chunk_size=4096, timeout timeout_ms=-1, *code tcb)
Sends an HTTP message body in chunked transfer encoding.
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash< auto > headers, string body, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and an optional message body.
const X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
Format error in certificate's notAfter field (invalid time)
Definition: QC_Socket.dox.h:2790
binary binary()
Always returns an empty binary object (of zero length)