Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -34,13 +34,13 @@ * To connect to a server, create a socket and connect it. * To create a server, create a socket, bind it and listen on it. */ @interface OFTCPSocket: OFStreamSocket { - BOOL isListening; - struct sockaddr *sockAddr; - socklen_t sockAddrLen; + BOOL isListening; + struct sockaddr_storage *sockAddr; + socklen_t sockAddrLen; } /** * Connect the OFTCPSocket to the specified destination. * Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -349,11 +349,11 @@ } - (OFTCPSocket*)accept { OFTCPSocket *newsock; - struct sockaddr *addr; + struct sockaddr_storage *addr; socklen_t addrlen; int s; newsock = [[[isa alloc] init] autorelease]; addrlen = sizeof(struct sockaddr); @@ -363,11 +363,12 @@ } @catch (id e) { [newsock release]; @throw e; } - if ((s = accept(sock, addr, &addrlen)) == INVALID_SOCKET) { + if ((s = accept(sock, (struct sockaddr*)addr, + &addrlen)) == INVALID_SOCKET) { [newsock release]; @throw [OFAcceptFailedException newWithClass: isa socket: self]; } @@ -395,12 +396,12 @@ #ifdef HAVE_THREADSAFE_GETADDRINFO char *host = [self allocMemoryWithSize: NI_MAXHOST]; @try { - if (getnameinfo(sockAddr, sockAddrLen, host, NI_MAXHOST, NULL, - 0, NI_NUMERICHOST)) + if (getnameinfo((struct sockaddr*)sockAddr, sockAddrLen, host, + NI_MAXHOST, NULL, 0, NI_NUMERICHOST)) @throw [OFAddressTranslationFailedException newWithClass: isa]; return [OFString stringWithCString: host]; } @finally {