@@ -56,12 +56,12 @@ saddr = NULL; return self; } -- connectToService: (OFString*)service - onNode: (OFString*)node +- (void)connectToService: (OFString*)service + onNode: (OFString*)node { if (sock != INVALID_SOCKET) @throw [OFAlreadyConnectedException newWithClass: isa]; #ifdef HAVE_THREADSAFE_GETADDRINFO @@ -186,17 +186,15 @@ if (sock == INVALID_SOCKET) @throw [OFConnectionFailedException newWithClass: isa node: node service: service]; - - return self; } -- bindService: (OFString*)service - onNode: (OFString*)node - withFamily: (int)family +- (void)bindService: (OFString*)service + onNode: (OFString*)node + withFamily: (int)family { if (sock != INVALID_SOCKET) @throw [OFAlreadyConnectedException newWithClass: isa]; #ifndef HAVE_THREADSAFE_GETADDRINFO @@ -304,36 +302,30 @@ node: node service: service family: family]; } #endif - - return self; } -- listenWithBackLog: (int)backlog +- (void)listenWithBackLog: (int)backlog { if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; if (listen(sock, backlog) == -1) @throw [OFListenFailedException newWithClass: isa backLog: backlog]; - - return self; } -- listen +- (void)listen { if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; if (listen(sock, 5) == -1) @throw [OFListenFailedException newWithClass: isa backLog: 5]; - - return self; } - (OFTCPSocket*)accept { OFTCPSocket *newsock; @@ -361,18 +353,16 @@ newsock->saddr_len = addrlen; return newsock; } -- enableKeepAlives: (BOOL)enable +- (void)setKeepAlivesEnabled: (BOOL)enable { int v = enable; if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, sizeof(v))) @throw [OFSetOptionFailedException newWithClass: isa]; - - return self; } - (OFString*)remoteAddress { if (saddr == NULL || saddr_len == 0) @@ -390,13 +380,10 @@ return [OFString stringWithCString: node]; } @finally { [self freeMemory: node]; } - - /* Get rid of a warning, never reached anyway */ - assert(0); #else char *node; # ifdef OF_THREADS [mutex lock]; @@ -412,18 +399,18 @@ return [OFString stringWithCString: node]; # ifdef OF_THREADS } @finally { [mutex unlock]; } +# endif +#endif /* Get rid of a warning, never reached anyway */ assert(0); -# endif -#endif } -- close +- (void)close { if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; close(sock); @@ -430,12 +417,10 @@ sock = INVALID_SOCKET; [self freeMemory: saddr]; saddr = NULL; saddr_len = 0; - - return self; } - (void)dealloc { if (sock != INVALID_SOCKET)