All Classes Namespaces Functions Variables Groups Pages
QC_Socket.dox.h
namespace Qore {
class Socket {
public:
Socket accept();
public:
*Socket accept(timeout timeout_ms);
public:
Socket acceptSSL();
public:
*Socket acceptSSL(timeout timeout_ms);
public:
int bind(string str, softbool reuseaddr = False);
public:
int bind(int port, softbool reuseaddr = False);
public:
nothing bindINET(*string iface, *softstring service, softbool reuseaddr = False, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
nothing bindUNIX(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
int close();
public:
nothing connect(string target, timeout timeout_ms = -1);
public:
nothing connectINET(string host, softstring service, timeout timeout_ms = -1, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
nothing connectINETSSL(string host, softstring service, timeout timeout_ms = -1, softint family = AF_UNSPEC, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
nothing connectSSL(string target, timeout timeout_ms = -1);
public:
nothing connectUNIX(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
nothing connectUNIXSSL(string path, softint socktype = SOCK_STREAM, softint protocol = 0);
public:
constructor();
public:
copy();
public:
string getCharset();
public:
string getEncoding();
public:
bool getNoDelay();
public:
hash getPeerInfo();
public:
int getPort();
public:
int getRecvTimeout();
public:
*string getSSLCipherName();
public:
*string getSSLCipherVersion();
public:
int getSendTimeout();
public:
int getSocket();
public:
hash getSocketInfo();
public:
bool isDataAvailable(timeout timeout_ms = 0);
public:
bool isOpen();
public:
bool isSecure();
public:
bool isWriteFinished(timeout timeout_ms = 0);
public:
int listen();
public:
hash readHTTPChunkedBody(timeout timeout_ms = -1);
public:
hash readHTTPChunkedBodyBinary(timeout timeout_ms = -1);
public:
hash readHTTPHeader(timeout timeout_ms = -1, *reference info);
public:
string recv(softint size = 0, timeout timeout_ms = -1);
public:
binary recvBinary(softint size = 0, timeout timeout_ms = -1);
public:
int recvi1(timeout timeout_ms = -1);
public:
int recvi2(timeout timeout_ms = -1);
public:
int recvi2LSB(timeout timeout_ms = -1);
public:
int recvi4(timeout timeout_ms = -1);
public:
int recvi4LSB(timeout timeout_ms = -1);
public:
int recvi8(timeout timeout_ms = -1);
public:
int recvi8LSB(timeout timeout_ms = -1);
public:
int recvu1(timeout timeout_ms = -1);
public:
int recvu2(timeout timeout_ms = -1);
public:
int recvu2LSB(timeout timeout_ms = -1);
public:
int recvu4(timeout timeout_ms = -1);
public:
int recvu4LSB(timeout timeout_ms = -1);
public:
int send(binary bin, int timeout_ms = -1);
public:
int send(string str, timeout timeout_ms = -1);
public:
nothing send2(binary bin, timeout timeout_ms = -1);
public:
nothing send2(string str, timeout timeout_ms = -1);
public:
int sendBinary(string str, timeout timeout_ms = -1);
public:
int sendBinary(binary bin, timeout timeout_ms = -1);
public:
nothing sendBinary2(string str, timeout timeout_ms = -1);
public:
nothing sendBinary2(binary bin, timeout timeout_ms = -1);
public:
nothing sendHTTPMessage(string method, string path, string http_version, hash headers, *string body, *reference info, timeout timeout_ms = -1);
public:
nothing sendHTTPMessage(string method, string path, string http_version, hash headers, binary body, *reference info, timeout timeout_ms = -1);
public:
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash headers, *string body, timeout timeout_ms = -1);
public:
nothing sendHTTPResponse(softint status_code, string status_desc, string http_version, hash headers, binary body, timeout timeout_ms = -1);
public:
int sendi1(softint i = 0, timeout timeout_ms = -1);
public:
int sendi2(softint i = 0, timeout timeout_ms = -1);
public:
int sendi2LSB(softint i = 0, timeout timeout_ms = -1);
public:
int sendi4(softint i = 0, timeout timeout_ms = -1);
public:
int sendi4LSB(softint i = 0, timeout timeout_ms = -1);
public:
int sendi8(softint i = 0, timeout timeout_ms = -1);
public:
int sendi8LSB(softint i = 0, timeout timeout_ms = -1);
public:
nothing setCertificate(SSLCertificate cert);
public:
nothing setCertificate(string cert_pem);
public:
nothing setCertificate(binary cert_der);
public:
nothing setCharset(string encoding);
public:
nothing setEncoding(string encoding);
public:
nothing setEventQueue();
public:
nothing setEventQueue(Queue queue);
public:
int setNoDelay(bool nd = True);
public:
nothing setPrivateKey(SSLPrivateKey key);
public:
nothing setPrivateKey(string key_pem, *string pass);
public:
nothing setPrivateKey(binary key_der);
public:
int setRecvTimeout(timeout timeout_ms);
public:
int setSendTimeout(timeout timeout_ms);
public:
int shutdown();
public:
nothing shutdownSSL();
public:
nothing upgradeClientToSSL();
public:
nothing upgradeServerToSSL();
public:
*string verifyPeerCertificate();
};
const X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH";
const X509_V_ERR_AKID_SKID_MISMATCH = "X509_V_ERR_AKID_SKID_MISMATCH";
const X509_V_ERR_APPLICATION_VERIFICATION = "X509_V_ERR_APPLICATION_VERIFICATION";
const X509_V_ERR_CERT_CHAIN_TOO_LONG = "X509_V_ERR_CERT_CHAIN_TOO_LONG";
const X509_V_ERR_CERT_HAS_EXPIRED = "X509_V_ERR_CERT_HAS_EXPIRED";
const X509_V_ERR_CERT_NOT_YET_VALID = "X509_V_ERR_CERT_NOT_YET_VALID";
const X509_V_ERR_CERT_REJECTED = "X509_V_ERR_CERT_REJECTED";
const X509_V_ERR_CERT_REVOKED = "X509_V_ERR_CERT_REVOKED";
const X509_V_ERR_CERT_SIGNATURE_FAILURE = "X509_V_ERR_CERT_SIGNATURE_FAILURE";
const X509_V_ERR_CERT_UNTRUSTED = "X509_V_ERR_CERT_UNTRUSTED";
const X509_V_ERR_CRL_HAS_EXPIRED = "X509_V_ERR_CRL_HAS_EXPIRED";
const X509_V_ERR_CRL_NOT_YET_VALID = "X509_V_ERR_CRL_NOT_YET_VALID";
const X509_V_ERR_CRL_SIGNATURE_FAILURE = "X509_V_ERR_CRL_SIGNATURE_FAILURE";
const X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT";
const X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD";
const X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD";
const X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD";
const X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD";
const X509_V_ERR_INVALID_CA = "X509_V_ERR_INVALID_CA";
const X509_V_ERR_INVALID_PURPOSE = "X509_V_ERR_INVALID_PURPOSE";
const X509_V_ERR_KEYUSAGE_NO_CERTSIGN = "X509_V_ERR_KEYUSAGE_NO_CERTSIGN";
const X509_V_ERR_OUT_OF_MEM = "X509_V_ERR_OUT_OF_MEM";
const X509_V_ERR_PATH_LENGTH_EXCEEDED = "X509_V_ERR_PATH_LENGTH_EXCEEDED";
const X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN";
const X509_V_ERR_SUBJECT_ISSUER_MISMATCH = "X509_V_ERR_SUBJECT_ISSUER_MISMATCH";
const X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY";
const X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE";
const X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE";
const X509_V_ERR_UNABLE_TO_GET_CRL = "X509_V_ERR_UNABLE_TO_GET_CRL";
const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT";
const X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY";
const X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE";
const X509_V_OK = "X509_V_OK";
const X509_VerificationReasons = (
"X509_V_OK": "OK",
"X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT": "Unable to get issuer certificate",
"X509_V_ERR_UNABLE_TO_GET_CRL": "Unable to get certificate CRL",
"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",
"X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE": "Unable to decrypt CRL's signature",
"X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY": "Unable to decode issuer public key (SubjectPublicKeyInfo)",
"X509_V_ERR_CERT_SIGNATURE_FAILURE": "Certificate signature failure; the signature of the certificate is invalid",
"X509_V_ERR_CRL_SIGNATURE_FAILURE": "CRL signature failure; the signature of the certificate is invalid",
"X509_V_ERR_CERT_NOT_YET_VALID": "Certificate is not yet valid",
"X509_V_ERR_CERT_HAS_EXPIRED": "Certificate has expired",
"X509_V_ERR_CRL_NOT_YET_VALID": "CRL is not yet valid",
"X509_V_ERR_CRL_HAS_EXPIRED": "CRL has expired",
"X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD": "Format error in certificate's notBefore field (invalid time)",
"X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD": "Format error in certificate's notAfter field (invalid time)",
"X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD": "Format error in CRL's lastUpdate field (invalid time)",
"X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD": "Format error in CRL's nextUpdate field (invalid time)",
"X509_V_ERR_OUT_OF_MEM": "Out of memory error",
"X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT": "Certificate is self-signed and cannot be found in the trusted list",
"X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN": "Self signed certificate in certificate chain",
"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",
"X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE": "Unable to verify the first certificate",
"X509_V_ERR_CERT_CHAIN_TOO_LONG": "Certificate chain too long",
"X509_V_ERR_CERT_REVOKED": "Certificate has been revoked",
"X509_V_ERR_INVALID_CA": "Invalid CA certificate",
"X509_V_ERR_PATH_LENGTH_EXCEEDED": "The basicConstraints pathlength parameter has been exceeded",
"X509_V_ERR_INVALID_PURPOSE": "The certificate cannot be used for the specified purpose",
"X509_V_ERR_CERT_UNTRUSTED": "Root CA is not marked as trusted for the specified purpose",
"X509_V_ERR_CERT_REJECTED": "Root CA is marked to reject the specified purpose",
"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",
"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",
"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",
"X509_V_ERR_KEYUSAGE_NO_CERTSIGN": "The keyUsage extension does not permit certificate signing",
"X509_V_ERR_APPLICATION_VERIFICATION": "Verification failure",
);
const AF_INET = AF_INET;
const AF_INET6 = AF_INET6;
const AF_LOCAL = AF_LOCAL;
const AF_UNIX = AF_UNIX;
const AF_UNSPEC = AF_UNSPEC;
const AI_ADDRCONFIG = AI_ADDRCONFIG;
const AI_ALL = AI_ALL;
const AI_CANONNAME = AI_CANONNAME;
const AI_NUMERICHOST = AI_NUMERICHOST;
const AI_NUMERICSERV = AI_NUMERICSERV;
const AI_PASSIVE = AI_PASSIVE;
const AI_V4MAPPED = AI_V4MAPPED;
const IPPROTO_TCP = IPPROTO_TCP;
const IPPROTO_UDP = IPPROTO_UDP;
const SOCK_DGRAM = SOCK_DGRAM;
const SOCK_RAW = SOCK_RAW;
const SOCK_STREAM = SOCK_STREAM;
};