Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -209,11 +209,11 @@ /*! * @brief Accept an incoming connection. * * @return An autoreleased OFTCPSocket for the accepted connection. */ -- (OFTCPSocket*)accept; +- (instancetype)accept; /*! * @brief Asyncronously accept an incoming connection. * * @param target The target on which to execute the selector when a new Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -641,11 +641,11 @@ - (void)listen { [self listenWithBackLog: SOMAXCONN]; } -- (OFTCPSocket*)accept +- (instancetype)accept { OFTCPSocket *client; struct sockaddr_storage *addr; socklen_t addrLen; int socket; Index: src/OFTLSSocket.h ================================================================== --- src/OFTLSSocket.h +++ src/OFTLSSocket.h @@ -47,10 +47,26 @@ @property (assign) id delegate; @property (copy) OFString *certificateFile, *privateKeyFile; @property const char *privateKeyPassphrase; #endif +/*! + * @brief Initializes the TLS socket with the specified TCP socket as its + * underlying socket. + * + * @param socket The TCP socket to use as underlying socket + */ +- initWithSocket: (OFTCPSocket*)socket; + +/*! + * @brief Initiates the TLS handshake. + * + * @note This is only useful if you used @ref initWithSocket: to start TLS on + * a TCP socket which is already connected! + */ +- (void)startTLS; + /*! * @brief Sets a delegate for the TLS socket. * * @param delegate The delegate to use */