Qore Programming Language Reference Manual  0.9.10
QC_Socket.dox.h
1 
3 namespace Qore {
5 class Socket {
125 
126 public:
128 
143 
144 public:
146 
162 *Socket accept(timeout timeout_ms);
163 
164 public:
166 
182  acceptAllCertificates(bool accept_all = True);
183 
184 public:
186 
201 
202 public:
204 
220 *Socket acceptSSL(timeout timeout_ms);
221 
222 public:
224 
244 int bind(string str, softbool reuseaddr = False);
245 
246 public:
248 
262 int bind(int port, softbool reuseaddr = False);
263 
264 public:
266 
294 nothing bindINET(*string iface, *softstring service, softbool reuseaddr = False, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
295 
296 public:
298 
314 nothing bindUNIX(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
315 
316 public:
318 
332 
333 public:
335 
345 
346 public:
348 
358 
359 public:
361 
374 int close();
375 
376 public:
378 
403 nothing connect(string target, timeout timeout_ms = -1);
404 
405 public:
407 
431 nothing connectINET(string host, softstring service, timeout timeout_ms = -1, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
432 
433 public:
435 
460 nothing connectINETSSL(string host, softstring service, timeout timeout_ms = -1, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
461 
462 public:
464 
492 nothing connectSSL(string target, timeout timeout_ms = -1);
493 
494 public:
496 
515 nothing connectUNIX(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
516 
517 public:
519 
539 nothing connectUNIXSSL(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
540 
541 public:
543 
547 
548 public:
550 
553  copy();
554 
555 public:
557 
575 
576 public:
578 
584 string getCharset();
585 
586 public:
588 
603 
604 public:
606 
611 string getEncoding();
612 
613 public:
615 
627 bool getNoDelay();
628 
629 public:
631 
647 hash<auto> getPeerInfo(bool host_lookup = True);
648 
649 public:
651 
661 int getPort();
662 
663 public:
665 
676 
677 public:
679 
691 
692 public:
694 
705 
706 public:
708 
719 
720 public:
722 
733 
734 public:
736 
746 int getSocket();
747 
748 public:
750 
766 hash<auto> getSocketInfo(bool host_lookup = True);
767 
768 public:
770 
788 
789 public:
791 
812 hash<auto> getUsageInfo();
813 
814 public:
816 
830 bool isDataAvailable(timeout timeout_ms = 0);
831 
832 public:
834 
844 bool isOpen();
845 
846 public:
848 
858 bool isSecure();
859 
860 public:
862 
876 bool isWriteFinished(timeout timeout_ms = 0);
877 
878 public:
880 
893 int listen(int backlog = 20);
894 
895 public:
897 
905 
906 public:
908 
929 hash<auto> readHTTPChunkedBody(timeout timeout_ms = -1);
930 
931 public:
933 
954 hash<auto> readHTTPChunkedBodyBinary(timeout timeout_ms = -1);
955 
956 public:
958 
986  readHTTPChunkedBodyBinaryWithCallback(code rcb, timeout timeout_ms = -1);
987 
988 public:
990 
1012 hash<auto> readHTTPChunkedBodyToOutputStream(Qore::OutputStream os, timeout timeout_ms = -1);
1013 
1014 public:
1016 
1044  readHTTPChunkedBodyWithCallback(code rcb, timeout timeout_ms = -1);
1045 
1046 public:
1048 
1095 hash<auto> readHTTPHeader(timeout timeout_ms = -1, *reference<hash<auto>> info);
1096 
1097 public:
1099 
1122 string readHTTPHeaderString(timeout timeout_ms = -1);
1123 
1124 public:
1126 
1151 string recv(softint size = 0, timeout timeout_ms = -1);
1152 
1153 public:
1155 
1178 binary recvBinary(softint size = 0, timeout timeout_ms = -1);
1179 
1180 public:
1182 
1205 nothing recvToOutputStream(Qore::OutputStream os, softint size = -1, timeout timeout_ms = -1);
1206 
1207 public:
1209 
1231 int recvi1(timeout timeout_ms = -1);
1232 
1233 public:
1235 
1257 int recvi2(timeout timeout_ms = -1);
1258 
1259 public:
1261 
1283 int recvi2LSB(timeout timeout_ms = -1);
1284 
1285 public:
1287 
1309 int recvi4(timeout timeout_ms = -1);
1310 
1311 public:
1313 
1335 int recvi4LSB(timeout timeout_ms = -1);
1336 
1337 public:
1339 
1361 int recvi8(timeout timeout_ms = -1);
1362 
1363 public:
1365 
1387 int recvi8LSB(timeout timeout_ms = -1);
1388 
1389 public:
1391 
1413 int recvu1(timeout timeout_ms = -1);
1414 
1415 public:
1417 
1439 int recvu2(timeout timeout_ms = -1);
1440 
1441 public:
1443 
1465 int recvu2LSB(timeout timeout_ms = -1);
1466 
1467 public:
1469 
1491 int recvu4(timeout timeout_ms = -1);
1492 
1493 public:
1495 
1517 int recvu4LSB(timeout timeout_ms = -1);
1518 
1519 public:
1521 
1547 int send(binary bin, timeout timeout_ms = -1);
1548 
1549 public:
1551 
1579 int send(string str, timeout timeout_ms = -1);
1580 
1581 public:
1583 
1606 nothing send2(binary bin, timeout timeout_ms = -1);
1607 
1608 public:
1610 
1635 nothing send2(string str, timeout timeout_ms = -1);
1636 
1637 public:
1639 
1664 int sendBinary(string str, timeout timeout_ms = -1);
1665 
1666 public:
1668 
1693 int sendBinary(binary bin, timeout timeout_ms = -1);
1694 
1695 public:
1697 
1719 nothing sendBinary2(string str, timeout timeout_ms = -1);
1720 
1721 public:
1723 
1745 nothing sendBinary2(binary bin, timeout timeout_ms = -1);
1746 
1747 public:
1749 
1770 nothing sendFromInputStream(Qore::InputStream input_stream, softint size = -1, timeout timeout_ms = -1);
1771 
1772 public:
1774 
1805 nothing sendHTTPChunkedBodyFromInputStream(Qore::InputStream input_stream, int max_chunk_size = 4096, timeout timeout_ms = -1, *code tcb);
1806 
1807 public:
1809 
1832 nothing sendHTTPChunkedBodyTrailer(*hash<auto> trailer, timeout timeout_ms = -1);
1833 
1834 public:
1836 
1871 nothing sendHTTPMessage(string method, string path, string http_version, hash<auto> headers, string body, *reference<hash> info, timeout timeout_ms = -1);
1872 
1873 public:
1875 
1907 nothing sendHTTPMessage(string method, string path, string http_version, hash<auto> headers, *binary body, *reference<hash<auto>> info, timeout timeout_ms = -1);
1908 
1909 public:
1911 
1939 nothing sendHTTPMessageWithCallback(code scb, string method, string path, string http_version, hash<auto> headers, *reference<hash<auto>> info, timeout timeout_ms = -1);
1940 
1941 public:
1943 
1967 nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash<auto> headers, string body, timeout timeout_ms = -1);
1968 
1969 public:
1971 
2009 nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash<auto> headers, string body, *reference<hash<auto>> info, timeout timeout_ms = -1);
2010 
2011 public:
2013 
2042 nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash<auto> headers, *binary body, timeout timeout_ms = -1);
2043 
2044 public:
2046 
2080 nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash<auto> headers, *binary body, *reference<hash<auto>> info, timeout timeout_ms = -1);
2081 
2082 public:
2084 
2126 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);
2127 
2128 public:
2130 
2165 nothing sendHTTPResponseWithCallback(code scb, softint status_code, string status_desc, string http_version, hash<auto> headers, timeout timeout_ms = -1);
2166 
2167 public:
2169 
2207 nothing sendHTTPResponseWithCallback(code scb, softint status_code, string status_desc, string http_version, hash<auto> headers, *reference<hash<auto>> info, timeout timeout_ms = -1);
2208 
2209 public:
2211 
2234 int sendi1(softint i = 0, timeout timeout_ms = -1);
2235 
2236 public:
2238 
2261 int sendi2(softint i = 0, timeout timeout_ms = -1);
2262 
2263 public:
2265 
2288 int sendi2LSB(softint i = 0, timeout timeout_ms = -1);
2289 
2290 public:
2292 
2315 int sendi4(softint i = 0, timeout timeout_ms = -1);
2316 
2317 public:
2319 
2342 int sendi4LSB(softint i = 0, timeout timeout_ms = -1);
2343 
2344 public:
2346 
2369 int sendi8(softint i = 0, timeout timeout_ms = -1);
2370 
2371 public:
2373 
2396 int sendi8LSB(softint i = 0, timeout timeout_ms = -1);
2397 
2398 public:
2400 
2408 
2409 public:
2411 
2418 nothing setCertificate(string cert_pem);
2419 
2420 public:
2422 
2429 nothing setCertificate(binary cert_der);
2430 
2431 public:
2433 
2436 nothing setCharset(string encoding);
2437 
2438 public:
2440 
2442 nothing setEncoding(string encoding);
2443 
2444 public:
2446 
2453 nothing setEventQueue();
2454 
2455 public:
2457 
2473 nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
2474 
2475 public:
2477 
2495 int setNoDelay(bool nd = True);
2496 
2497 public:
2499 
2507 
2508 public:
2510 
2518 nothing setPrivateKey(string key_pem, *string pass);
2519 
2520 public:
2522 
2529 nothing setPrivateKey(binary key_der);
2530 
2531 public:
2533 
2545 int setRecvTimeout(timeout timeout_ms);
2546 
2547 public:
2549 
2561 int setSendTimeout(timeout timeout_ms);
2562 
2563 public:
2565 
2582  setSslVerifyMode(int mode);
2583 
2584 public:
2586 
2618 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
2619 
2620 public:
2622 
2632 int shutdown();
2633 
2634 public:
2636 
2645 nothing shutdownSSL();
2646 
2647 public:
2649 
2663 nothing upgradeClientToSSL(timeout timeout_ms = -1);
2664 
2665 public:
2667 
2681 nothing upgradeServerToSSL(timeout timeout_ms = -1);
2682 
2683 public:
2685 
2696 };
2703 
2716 
2728 
2737 
2762  const X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH";
2765  const X509_V_ERR_AKID_SKID_MISMATCH = "X509_V_ERR_AKID_SKID_MISMATCH";
2767  const X509_V_ERR_APPLICATION_VERIFICATION = "X509_V_ERR_APPLICATION_VERIFICATION";
2769  const X509_V_ERR_CERT_CHAIN_TOO_LONG = "X509_V_ERR_CERT_CHAIN_TOO_LONG";
2771  const X509_V_ERR_CERT_HAS_EXPIRED = "X509_V_ERR_CERT_HAS_EXPIRED";
2773  const X509_V_ERR_CERT_NOT_YET_VALID = "X509_V_ERR_CERT_NOT_YET_VALID";
2775  const X509_V_ERR_CERT_REJECTED = "X509_V_ERR_CERT_REJECTED";
2777  const X509_V_ERR_CERT_REVOKED = "X509_V_ERR_CERT_REVOKED";
2779  const X509_V_ERR_CERT_SIGNATURE_FAILURE = "X509_V_ERR_CERT_SIGNATURE_FAILURE";
2781  const X509_V_ERR_CERT_UNTRUSTED = "X509_V_ERR_CERT_UNTRUSTED";
2783  const X509_V_ERR_CRL_HAS_EXPIRED = "X509_V_ERR_CRL_HAS_EXPIRED";
2785  const X509_V_ERR_CRL_NOT_YET_VALID = "X509_V_ERR_CRL_NOT_YET_VALID";
2787  const X509_V_ERR_CRL_SIGNATURE_FAILURE = "X509_V_ERR_CRL_SIGNATURE_FAILURE";
2789  const X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT";
2791  const X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD";
2793  const X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD";
2795  const X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD";
2797  const X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD";
2799  const X509_V_ERR_INVALID_CA = "X509_V_ERR_INVALID_CA";
2801  const X509_V_ERR_INVALID_PURPOSE = "X509_V_ERR_INVALID_PURPOSE";
2803  const X509_V_ERR_KEYUSAGE_NO_CERTSIGN = "X509_V_ERR_KEYUSAGE_NO_CERTSIGN";
2805  const X509_V_ERR_OUT_OF_MEM = "X509_V_ERR_OUT_OF_MEM";
2807  const X509_V_ERR_PATH_LENGTH_EXCEEDED = "X509_V_ERR_PATH_LENGTH_EXCEEDED";
2809  const X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN";
2811  const X509_V_ERR_SUBJECT_ISSUER_MISMATCH = "X509_V_ERR_SUBJECT_ISSUER_MISMATCH";
2813  const X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY";
2815  const X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE";
2817  const X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE";
2819  const X509_V_ERR_UNABLE_TO_GET_CRL = "X509_V_ERR_UNABLE_TO_GET_CRL";
2821  const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT";
2823  const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY";
2825  const X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE";
2827  const X509_V_OK = "X509_V_OK";
2830  "X509_V_OK": "OK",
2831  "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT": "Unable to get issuer certificate",
2832  "X509_V_ERR_UNABLE_TO_GET_CRL": "Unable to get certificate CRL",
2833  "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",
2834  "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE": "Unable to decrypt CRL's signature",
2835  "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY": "Unable to decode issuer public key (SubjectPublicKeyInfo)",
2836  "X509_V_ERR_CERT_SIGNATURE_FAILURE": "Certificate signature failure; the signature of the certificate is invalid",
2837  "X509_V_ERR_CRL_SIGNATURE_FAILURE": "CRL signature failure; the signature of the certificate is invalid",
2838  "X509_V_ERR_CERT_NOT_YET_VALID": "Certificate is not yet valid",
2839  "X509_V_ERR_CERT_HAS_EXPIRED": "Certificate has expired",
2840  "X509_V_ERR_CRL_NOT_YET_VALID": "CRL is not yet valid",
2841  "X509_V_ERR_CRL_HAS_EXPIRED": "CRL has expired",
2842  "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD": "Format error in certificate's notBefore field (invalid time)",
2843  "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD": "Format error in certificate's notAfter field (invalid time)",
2844  "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD": "Format error in CRL's lastUpdate field (invalid time)",
2845  "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD": "Format error in CRL's nextUpdate field (invalid time)",
2846  "X509_V_ERR_OUT_OF_MEM": "Out of memory error",
2847  "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT": "Certificate is self-signed and cannot be found in the trusted list",
2848  "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN": "Self signed certificate in certificate chain",
2849  "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",
2850  "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE": "Unable to verify the first certificate",
2851  "X509_V_ERR_CERT_CHAIN_TOO_LONG": "Certificate chain too long",
2852  "X509_V_ERR_CERT_REVOKED": "Certificate has been revoked",
2853  "X509_V_ERR_INVALID_CA": "Invalid CA certificate",
2854  "X509_V_ERR_PATH_LENGTH_EXCEEDED": "The basicConstraints pathlength parameter has been exceeded",
2855  "X509_V_ERR_INVALID_PURPOSE": "The certificate cannot be used for the specified purpose",
2856  "X509_V_ERR_CERT_UNTRUSTED": "Root CA is not marked as trusted for the specified purpose",
2857  "X509_V_ERR_CERT_REJECTED": "Root CA is marked to reject the specified purpose",
2858  "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",
2859  "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",
2860  "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",
2861  "X509_V_ERR_KEYUSAGE_NO_CERTSIGN": "The keyUsage extension does not permit certificate signing",
2862  "X509_V_ERR_APPLICATION_VERIFICATION": "Verification failure",
2863  );
2870  const AFMap = qore(get_network_address_family_map());
2873  const AFStrMap = (
2874  "AF_INET": AF_INET,
2875  "AF_INET6": AF_INET6,
2876  "AF_UNIX": AF_UNIX,
2877  "AF_LOCAL": AF_UNIX,
2878  "AF_UNSPEC": AF_UNSPEC,
2879  );
2881  const AF_INET = AF_INET;
2887  const AF_UNIX = AF_UNIX;
2897  const AI_ADDRCONFIG = AI_ADDRCONFIG;
2900  const AI_ALL = AI_ALL;
2906 
2911 
2919 
2928  const IPPROTO_TCP = IPPROTO_TCP;
2938  const SOCK_DGRAM = SOCK_DGRAM;
2945 }
Qore::X509_VerificationReasons
const X509_VerificationReasons
maps from varification strings to verification code descriptions
Definition: QC_Socket.dox.h:2829
Qore::Socket::bindUNIX
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....
Qore::Socket::recvu2LSB
int recvu2LSB(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) unsigned integer in little-endian format from the socket.
Qore::Socket::getCharset
string getCharset()
Returns the character encoding for the socket.
Qore::X509_V_ERR_UNABLE_TO_GET_CRL
const X509_V_ERR_UNABLE_TO_GET_CRL
Unable to get certificate CRL.
Definition: QC_Socket.dox.h:2819
Qore::AFMap
const AFMap
mapping from Network Address Family Constants to string codes
Definition: QC_Socket.dox.h:2871
Qore::Socket::recvu4LSB
int recvu4LSB(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) unsigned integer in little-endian format from the socket.
Qore::Socket::isSecure
bool isSecure()
Returns True if the connection is a secure TLS/SSL connection.
Qore::AI_PASSIVE
const AI_PASSIVE
If this bit is set, then the returned information should be usable for a call to Socket::bind()
Definition: QC_Socket.dox.h:2917
Qore::X509_V_ERR_CRL_SIGNATURE_FAILURE
const X509_V_ERR_CRL_SIGNATURE_FAILURE
CRL signature failure; the signature of the certificate is invalid.
Definition: QC_Socket.dox.h:2787
Qore::AI_ALL
const AI_ALL
If this bit is set along with AI_V4MAPPED then all matching IPv6 and IPv4 addresses are returned.
Definition: QC_Socket.dox.h:2900
Qore::Socket::recvi2LSB
int recvi2LSB(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) signed integer in little-endian format from the socket.
Qore::SSL_VERIFY_NONE
const SSL_VERIFY_NONE
Do not verify the peer's certificate.
Definition: QC_Socket.dox.h:2735
Qore::Socket::recvu1
int recvu1(timeout timeout_ms=-1)
Receives a 1-byte unsigned integer from the socket.
Qore::Socket::recvi8LSB
int recvi8LSB(timeout timeout_ms=-1)
Receives an 8-byte (64-bit) signed integer in little-endian format from the socket.
Qore::Socket::sendHTTPChunkedBodyTrailer
nothing sendHTTPChunkedBodyTrailer(*hash< auto > trailer, timeout timeout_ms=-1)
Sends the trialer of an HTTP message body in chunked transfer encoding.
Qore::Socket::readHTTPChunkedBody
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...
Qore::X509_V_ERR_AKID_SKID_MISMATCH
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:2765
Qore::Socket::acceptSSL
Socket acceptSSL()
Accepts connections on a listening socket and attempts to negotiate a TLS/SSL connection.
Qore::Socket::isDataAvailable
bool isDataAvailable(timeout timeout_ms=0)
Returns True or False depending on whether there is data to be read on the socket.
Qore::Socket::sendi4
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.
Qore::Socket::getUsageInfo
hash< auto > getUsageInfo()
Returns performance statistics for the socket.
Qore::X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
const X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
Unable to decode issuer public key (SubjectPublicKeyInfo)
Definition: QC_Socket.dox.h:2813
Qore::X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH
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:2763
Qore::Socket::sendHTTPResponseWithCallback
nothing sendHTTPResponseWithCallback(code scb, softint status_code, string status_desc, string http_version, hash< auto > headers, *reference< hash< auto >> info, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and a message body to send with chun...
Qore::Socket::getEncoding
string getEncoding()
Returns the character encoding for the socket.
Qore::SOCK_STREAM
const SOCK_STREAM
for sequenced, reliable, two-way connection-based byte streams (the default)
Definition: QC_Socket.dox.h:2943
Qore::Socket::sendHTTPMessage
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 ...
Qore::X509_V_ERR_KEYUSAGE_NO_CERTSIGN
const X509_V_ERR_KEYUSAGE_NO_CERTSIGN
The keyUsage extension does not permit certificate signing.
Definition: QC_Socket.dox.h:2803
Qore::Socket::sendi2LSB
int sendi2LSB(softint i=0, timeout timeout_ms=-1)
Sends a 2-byte (16-bit) integer in little-endian format over the socket.
Qore::AI_NUMERICSERV
const AI_NUMERICSERV
If this bit is set, then the service is assumed to be a numeric port string, and no service lookup wi...
Definition: QC_Socket.dox.h:2909
Qore::SOCK_RAW
const SOCK_RAW
raw socket interface, only available to the superuser, untested
Definition: QC_Socket.dox.h:2941
Qore::Socket::connectINETSSL
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...
Qore::Socket::readHTTPChunkedBodyWithCallback
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...
Qore::Socket::sendi8
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.
Qore::Socket::acceptAllCertificates
acceptAllCertificates(bool accept_all=True)
with peer verification enabled, all certificates are accepted regardless of the validity of the Certi...
Qore::Socket::shutdownSSL
nothing shutdownSSL()
Shuts down the SSL connection on a secure connection.
Qore::Socket::recvi1
int recvi1(timeout timeout_ms=-1)
Receives a 1-byte signed integer from the socket.
Qore::AF_INET6
const AF_INET6
IPv6 address family.
Definition: QC_Socket.dox.h:2883
Qore::IPPROTO_TCP
const IPPROTO_TCP
for the TCP protocol
Definition: QC_Socket.dox.h:2929
Qore::Socket::recv
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.
Qore::X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
const X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE
Unable to decrypt CRL's signature.
Definition: QC_Socket.dox.h:2817
Qore::Socket::isWriteFinished
bool isWriteFinished(timeout timeout_ms=0)
Returns True or False depending on whether all the data has been written to the socket.
Qore::Socket::recvi4
int recvi4(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) signed integer in big-endian format (network byte order) from the socket.
Qore::X509_V_ERR_APPLICATION_VERIFICATION
const X509_V_ERR_APPLICATION_VERIFICATION
Verification failure.
Definition: QC_Socket.dox.h:2767
Qore::Socket::readHTTPHeader
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...
Qore::Socket::connect
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...
Qore::X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
const X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD
Format error in CRL's nextUpdate field (invalid time)
Definition: QC_Socket.dox.h:2797
Qore::Socket::bindINET
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,...
Qore::AFStrMap
const AFStrMap
mapping from network address family string codes to Network Address Family Constants
Definition: QC_Socket.dox.h:2873
Qore::Socket::setPrivateKey
nothing setPrivateKey(SSLPrivateKey key)
Sets the private key to use for negotiating encrypted connections along with the X....
Qore::X509_V_ERR_PATH_LENGTH_EXCEEDED
const X509_V_ERR_PATH_LENGTH_EXCEEDED
The basicConstraints pathlength parameter has been exceeded.
Definition: QC_Socket.dox.h:2807
Qore::X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
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:2789
Qore::IPPROTO_UDP
const IPPROTO_UDP
for the UDP protocol
Definition: QC_Socket.dox.h:2931
Qore::Socket::setCertificate
nothing setCertificate(binary cert_der)
Sets the X.509 certificate to use for negotiating encrypted connections from the DER-encoded binary o...
Qore::Socket::pendingHttpChunkedBody
bool pendingHttpChunkedBody()
returns True if the socket is still connected, and a HTTP header was read indicating chunked transfer...
Qore::Socket::send2
nothing send2(string str, timeout timeout_ms=-1)
Sends string data over the socket; string data is converted to the socket's encoding if necessary; if...
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
Qore::X509_V_ERR_CERT_UNTRUSTED
const X509_V_ERR_CERT_UNTRUSTED
Root CA is not marked as trusted for the specified purpose.
Definition: QC_Socket.dox.h:2781
Qore::Socket::isOpen
bool isOpen()
Returns True if the socket is open.
Qore::Socket::sendi4LSB
int sendi4LSB(softint i=0, timeout timeout_ms=-1)
Sends a 4-byte (32-bit) integer in little-endian format over the socket.
Qore::Socket::getRemoteCertificate
*SSLCertificate getRemoteCertificate()
Returns any remote certificate captured or NOTHING if there is none.
Qore::Socket::setPrivateKey
nothing setPrivateKey(binary key_der)
Sets the private key to use for negotiating encrypted connections along with the X....
Qore::Socket::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data)
Sets a Queue object to receive socket events.
Qore::Socket::upgradeServerToSSL
nothing upgradeServerToSSL(timeout timeout_ms=-1)
Upgrades a server socket connection to a TLS/SSL connection.
Qore::X509_V_ERR_CERT_SIGNATURE_FAILURE
const X509_V_ERR_CERT_SIGNATURE_FAILURE
Certificate signature failure; the signature of the certificate is invalid.
Definition: QC_Socket.dox.h:2779
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition: QC_Queue.dox.h:22
Qore::Socket::send
int send(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
Qore::Socket::getSendTimeout
int getSendTimeout()
Returns the send timeout socket option value as an integer in milliseconds.
Qore::Socket::bind
int bind(int port, softbool reuseaddr=False)
Opens and binds the socket to an INET port on all interfaces.
Qore::Socket::getSocket
int getSocket()
Returns the socket file descriptor number.
Qore::X509_V_ERR_CERT_HAS_EXPIRED
const X509_V_ERR_CERT_HAS_EXPIRED
Certificate has expired.
Definition: QC_Socket.dox.h:2771
Qore::Socket::readHTTPHeaderString
string readHTTPHeaderString(timeout timeout_ms=-1)
Retuns a string representing the data in the HTTP header read (reads until "\r\n\r\n")
Qore::X509_V_ERR_INVALID_CA
const X509_V_ERR_INVALID_CA
Invalid CA certificate.
Definition: QC_Socket.dox.h:2799
Qore::X509_V_ERR_CERT_REVOKED
const X509_V_ERR_CERT_REVOKED
Certificate has been revoked.
Definition: QC_Socket.dox.h:2777
Qore::Socket::setCertificate
nothing setCertificate(string cert_pem)
Sets the X.509 certificate to use for negotiating encrypted connections from the PEM-encoded string r...
Qore::Socket::setWarningQueue
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
Qore::Socket::setSslVerifyMode
setSslVerifyMode(int mode)
sets the SSL verification mode
Qore::Socket::recvToOutputStream
nothing recvToOutputStream(Qore::OutputStream os, softint size=-1, timeout timeout_ms=-1)
Receives data from the socket and writes the bytes to an OutputStream.
Qore::Socket::sendHTTPResponse
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash< auto > headers, *binary body, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and a message body as literal binary...
Qore::Socket::readHTTPChunkedBodyBinaryWithCallback
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...
Qore::Socket::shutdown
int shutdown()
Ensures that a socket will be closed even if the file descriptor is shared with other processes (for ...
Qore::OutputStream
This class defines an abstract interface for output streams.
Definition: QC_OutputStream.dox.h:18
Qore::Socket::acceptSSL
*Socket acceptSSL(timeout timeout_ms)
Accepts connections on a listening socket and attempts to negotiate a TLS/SSL connection accepting a ...
Qore::Socket::setEncoding
nothing setEncoding(string encoding)
Sets the character encoding for the socket.
Qore::Socket::captureRemoteCertificates
bool captureRemoteCertificates(bool set=True)
Sets the flag for capturing remote X.509 certificates; by default no capture of remote certificates i...
Qore::Socket::getAcceptAllCertificates
bool getAcceptAllCertificates()
returns the current value of the "accept all certificates" flag
Qore::Socket::recvBinary
binary recvBinary(softint size=0, timeout timeout_ms=-1)
Receives data from the socket and returns a binary object.
Qore::Socket::verifyPeerCertificate
*string verifyPeerCertificate()
Returns a string code giving the result of verifying the remote certificate or NOTHING if an encrypte...
Qore::X509_V_ERR_SUBJECT_ISSUER_MISMATCH
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:2811
Qore::AF_LOCAL
const AF_LOCAL
POSIX synonym for AF_UNIX.
Definition: QC_Socket.dox.h:2885
Qore::Socket::upgradeClientToSSL
nothing upgradeClientToSSL(timeout timeout_ms=-1)
Upgrades a client socket connection to a TLS/SSL connection.
Qore::SSLPrivateKey
This class implements a container for private key data.
Definition: QC_SSLPrivateKey.dox.h:10
Qore::Socket::send2
nothing send2(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
Qore::Socket::copy
copy()
Creates a new Socket object, not based on the source being copied.
Qore::Socket::recvi4LSB
int recvi4LSB(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) signed integer in little-endian format from the socket.
Qore::Socket::sendi8LSB
int sendi8LSB(softint i=0, timeout timeout_ms=-1)
Sends an 8-byte (64-bit) integer in little-endian format over the socket.
Qore::Socket::sendHTTPResponse
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)
Sends an HTTP response with user-defined headers and a message body from an input stream in chunked t...
Qore::Socket::clearWarningQueue
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
Qore::SSL_VERIFY_CLIENT_ONCE
const SSL_VERIFY_CLIENT_ONCE
Only request a client certificate once in server mode.
Definition: QC_Socket.dox.h:2714
Qore::AI_CANONNAME
const AI_CANONNAME
If this bit is set, then getaddrinfo() will return the canonical name of the hostname in the "canonna...
Definition: QC_Socket.dox.h:2902
Qore::Socket::getSSLCipherVersion
*string getSSLCipherVersion()
Returns the version string of the cipher for an encrypted connection or NOTHING if a secure connectio...
Qore::Socket::setSendTimeout
int setSendTimeout(timeout timeout_ms)
sets the send timeout as a socket option
Qore::Socket::sendi2
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.
Qore::X509_V_ERR_CERT_CHAIN_TOO_LONG
const X509_V_ERR_CERT_CHAIN_TOO_LONG
Certificate chain too long.
Definition: QC_Socket.dox.h:2769
Qore::Socket::sendBinary
int sendBinary(string str, timeout timeout_ms=-1)
Sends string data over the socket without converting the string to the socket's encoding,...
Qore::Socket::getSSLCipherName
*string getSSLCipherName()
Returns the name of the cipher for an encrypted connection or NOTHING if a secure connection has not ...
Qore::Socket::bind
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...
Qore::Socket::getRecvTimeout
int getRecvTimeout()
Returns the receive timeout socket option value as an integer in milliseconds.
Qore::X509_V_OK
const X509_V_OK
Verification OK.
Definition: QC_Socket.dox.h:2827
Qore::Socket::getNoDelay
bool getNoDelay()
Returns the TCP_NODELAY setting for the socket.
Qore::Socket::setRecvTimeout
int setRecvTimeout(timeout timeout_ms)
sets the receive timeout as a socket option
Qore::AI_V4MAPPED
const AI_V4MAPPED
If this bit is set, getaddrinfo() will return IPv4-mapped IPv6 addresses on finding no matching IPv6 ...
Definition: QC_Socket.dox.h:2921
Qore::X509_V_ERR_CERT_REJECTED
const X509_V_ERR_CERT_REJECTED
Root CA is marked to reject the specified purpose.
Definition: QC_Socket.dox.h:2775
Qore::AF_INET
const AF_INET
IPv4 address family.
Definition: QC_Socket.dox.h:2881
Qore::Socket::readHTTPChunkedBodyBinary
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...
Qore::Socket::close
int close()
Closes an open socket.
Qore::X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
const X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN
Self signed certificate in certificate chain.
Definition: QC_Socket.dox.h:2809
Qore::Socket::sendi1
int sendi1(softint i=0, timeout timeout_ms=-1)
Sends a 1-byte integer over the socket.
Qore::X509_V_ERR_CRL_HAS_EXPIRED
const X509_V_ERR_CRL_HAS_EXPIRED
CRL has expired.
Definition: QC_Socket.dox.h:2783
Qore::Socket::setCharset
nothing setCharset(string encoding)
Sets the character encoding for the socket.
Qore::Socket::getSocketInfo
hash< auto > getSocketInfo(bool host_lookup=True)
Returns information about the local socket as a hash.
Qore::Socket::readHTTPChunkedBodyToOutputStream
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...
Qore::Socket::sendBinary
int sendBinary(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
Qore::Socket
The Socket class allows Qore programs safe access to network sockets.
Definition: QC_Socket.dox.h:124
Qore::X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
const X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD
Format error in CRL's lastUpdate field (invalid time)
Definition: QC_Socket.dox.h:2795
Qore::Socket::sendFromInputStream
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.
Qore::X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
const X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD
Format error in certificate's notBefore field (invalid time)
Definition: QC_Socket.dox.h:2793
Qore::SSL_VERIFY_FAIL_IF_NO_PEER_CERT
const SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Require a client certificate in server mode.
Definition: QC_Socket.dox.h:2726
Qore::X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE
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:2815
Qore::Socket::sendHTTPResponse
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash< auto > headers, string body, *reference< hash< auto >> info, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and an optional message body.
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
Qore::X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
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:2823
Qore::Socket::recvi2
int recvi2(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) signed integer in big-endian format (network byte order) from the socket.
Qore::X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT
Unable to get issuer certificate.
Definition: QC_Socket.dox.h:2821
Qore::Socket::recvu2
int recvu2(timeout timeout_ms=-1)
Receives a 2-byte (16-bit) unsigned integer in big-endian format (network byte order) from the socket...
Qore::Socket::sendHTTPResponseWithCallback
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...
Qore::Socket::sendHTTPMessage
nothing sendHTTPMessage(string method, string path, string http_version, hash< auto > headers, *binary body, *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 ...
Qore::Socket::send
int send(string str, timeout timeout_ms=-1)
Sends string data over the socket; string data is converted to the socket's encoding if necessary; if...
Qore::Socket::accept
*Socket accept(timeout timeout_ms)
Accepts connections on a listening socket (see Socket::listen()) accepting a timeout value with a mil...
Qore::Socket::clearStats
clearStats()
Clears performance statistics.
Qore::AI_ADDRCONFIG
const AI_ADDRCONFIG
if this bit is set, addresses of each family are returned only if they are configured on the system
Definition: QC_Socket.dox.h:2898
Qore::Socket::getSslVerifyMode
int getSslVerifyMode()
returns the current SSL verification mode
Qore::Socket::recvu4
int recvu4(timeout timeout_ms=-1)
Receives a 4-byte (32-bit) unsigned integer in big-endian format (network byte order) from the socket...
Qore::Socket::setNoDelay
int setNoDelay(bool nd=True)
Sets the boolean TCP_NODELAY setting for the socket.
Qore::X509_V_ERR_INVALID_PURPOSE
const X509_V_ERR_INVALID_PURPOSE
The certificate cannot be used for the specified purpose.
Definition: QC_Socket.dox.h:2801
Qore::X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
const X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE
Unable to verify the first certificate.
Definition: QC_Socket.dox.h:2825
Qore::Socket::sendHTTPMessageWithCallback
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 ...
Qore::SSLCertificate
SSLCertificate objects allow Qore code to work with X.509 certificate data.
Definition: QC_SSLCertificate.dox.h:10
Qore::Socket::listen
int listen(int backlog=20)
Listens for connections on a bound socket; sets the socket in a listening state.
Qore::Socket::setEventQueue
nothing setEventQueue()
Removes any Queue object from the Socket object so that socket events are no longer added to the Queu...
Qore::Socket::connectINET
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.
Qore::AF_UNIX
const AF_UNIX
UNIX domain address family (UNIX socket files)
Definition: QC_Socket.dox.h:2887
Qore::X509_V_ERR_OUT_OF_MEM
const X509_V_ERR_OUT_OF_MEM
Out of memory error.
Definition: QC_Socket.dox.h:2805
Qore::SOCK_DGRAM
const SOCK_DGRAM
for datagrams (connectionless, unreliable messages of a fixed (typically small) maximum length
Definition: QC_Socket.dox.h:2939
Qore::X509_V_ERR_CERT_NOT_YET_VALID
const X509_V_ERR_CERT_NOT_YET_VALID
Certificate is not yet valid.
Definition: QC_Socket.dox.h:2773
Qore::Socket::connectSSL
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...
Qore::Socket::sendBinary2
nothing sendBinary2(string str, timeout timeout_ms=-1)
Sends string data over the socket without converting the string to the socket's encoding,...
Qore::Socket::connectUNIX
nothing connectUNIX(string path, softint socktype=SOCK_STREAM, softint protocol=0)
Connects to a UNIX domain socket file.
Qore::AF_UNSPEC
const AF_UNSPEC
unspecified address family
Definition: QC_Socket.dox.h:2889
Qore::Socket::connectUNIXSSL
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.
Qore::Socket::setCertificate
nothing setCertificate(SSLCertificate cert)
Sets the X.509 certificate to use for negotiating encrypted connections.
Qore::Socket::sendHTTPResponse
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash< auto > headers, *binary body, *reference< hash< auto >> info, timeout timeout_ms=-1)
Sends an HTTP response with user-defined headers given as a hash and a message body as literal binary...
Qore::Socket::recvi8
int recvi8(timeout timeout_ms=-1)
Receives an 8-byte (64-bit) signed integer in big-endian format (network byte order) from the socket.
Qore::X509_V_ERR_CRL_NOT_YET_VALID
const X509_V_ERR_CRL_NOT_YET_VALID
CRL is not yet valid.
Definition: QC_Socket.dox.h:2785
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
Qore::Socket::getPort
int getPort()
Returns the port number of the socket for INET sockets.
Qore::Socket::setPrivateKey
nothing setPrivateKey(string key_pem, *string pass)
Sets the private key to use for negotiating encrypted connections along with the X....
Qore::Socket::getConnectionId
int getConnectionId()
Returns an integer connection ID that is incremented every time the socket is disconnected.
Qore::Socket::getPeerInfo
hash< auto > getPeerInfo(bool host_lookup=True)
Returns a hash of information about the remote end for connected sockets.
Qore::SSL_VERIFY_PEER
const SSL_VERIFY_PEER
Verify the peer's certificate.
Definition: QC_Socket.dox.h:2752
Qore::Socket::sendBinary2
nothing sendBinary2(binary bin, timeout timeout_ms=-1)
Sends binary data over the socket; if any errors occur, an exception is thrown.
Qore::Socket::accept
Socket accept()
Accepts connections on a listening socket.
Qore::Socket::constructor
constructor()
Creates the socket object.
Qore::Socket::sendHTTPChunkedBodyFromInputStream
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.
Qore::Socket::sendHTTPResponse
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.
Qore::InputStream
This class defines an abstract interface for input streams.
Definition: QC_InputStream.dox.h:19
Qore::AI_NUMERICHOST
const AI_NUMERICHOST
If this bit is set, then the host is assumed to be an address and no hostname lookup will be preforme...
Definition: QC_Socket.dox.h:2904
Qore::X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
const X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD
Format error in certificate's notAfter field (invalid time)
Definition: QC_Socket.dox.h:2791
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)