@@ -16,10 +16,12 @@ #import "OFStreamSocket.h" #import "socket.h" +OF_ASSUME_NONNULL_BEGIN + /*! @file */ @class OFTCPSocket; @class OFString; @@ -30,11 +32,11 @@ * @param socket The socket which connected * @param exception An exception which occurred while connecting the socket or * nil on success */ typedef void (^of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket, - OFException *exception); + __nullable OFException *exception); /*! * @brief A block which is called when the socket accepted a connection. * * @param socket The socket which accepted the connection @@ -43,11 +45,11 @@ * nil on success * @return A bool whether the same block should be used for the next incoming * connection */ typedef bool (^of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket, - OFTCPSocket *acceptedSocket, OFException *exception); + OFTCPSocket *acceptedSocket, __nullable OFException *exception); #endif /*! * @class OFTCPSocket OFTCPSocket.h ObjFW/OFTCPSocket.h * @@ -65,11 +67,11 @@ uint16_t _SOCKS5Port; } #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isListening) bool listening; -@property (copy) OFString *SOCKS5Host; +@property (copy, nullable) OFString *SOCKS5Host; @property uint16_t SOCKS5Port; @property (getter=isKeepAliveEnabled) bool keepAliveEnabled; @property (getter=isTCPNoDelayEnabled) bool TCPNoDelayEnabled; #endif @@ -77,18 +79,18 @@ * @brief Sets the global SOCKS5 proxy host to use when creating a new socket * * @param SOCKS5Host The host to use as a SOCKS5 proxy when creating a new * socket */ -+ (void)setSOCKS5Host: (OFString*)SOCKS5Host; ++ (void)setSOCKS5Host: (nullable OFString*)SOCKS5Host; /*! * @brief Returns the host to use as a SOCKS5 proxy when creating a new socket * * @return The host to use as a SOCKS5 proxy when creating a new socket */ -+ (OFString*)SOCKS5Host; ++ (nullable OFString*)SOCKS5Host; /*! * @brief Sets the global SOCKS5 proxy port to use when creating a new socket * * @param SOCKS5Port The port to use as a SOCKS5 proxy when creating a new socket @@ -105,18 +107,18 @@ /*! * @brief Sets the host to use as a SOCKS5 proxy. * * @param host The host to use as a SOCKS5 proxy */ -- (void)setSOCKS5Host: (OFString*)host; +- (void)setSOCKS5Host: (nullable OFString*)host; /*! * @brief Returns the host to use as a SOCKS5 proxy. * * @return The host to use as a SOCKS5 proxy */ -- (OFString*)SOCKS5Host; +- (nullable OFString*)SOCKS5Host; /*! * @brief Sets the port to use on the SOCKS5 proxy. * * The default port is 1080. @@ -232,11 +234,11 @@ * * Only works with accepted sockets! * * @return The remote address as a string */ -- (OFString*)remoteAddress; +- (nullable OFString*)remoteAddress; /*! * @brief Returns whether the socket is a listening socket. * * @return Whether the socket is a listening socket @@ -273,9 +275,11 @@ @end #ifdef __cplusplus extern "C" { #endif -extern Class of_tls_socket_class; +extern __nullable Class of_tls_socket_class; #ifdef __cplusplus } #endif + +OF_ASSUME_NONNULL_END