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 *newSocket; - struct sockaddr *addr; + struct sockaddr_storage *addr; socklen_t addrLen; int newSock; newSocket = [[[isa alloc] init] autorelease]; addrLen = sizeof(struct sockaddr); @@ -363,11 +363,12 @@ } @catch (id e) { [newSocket release]; @throw e; } - if ((newSock = accept(sock, addr, &addrLen)) == INVALID_SOCKET) { + if ((newSock = accept(sock, (struct sockaddr*)addr, + &addrLen)) == INVALID_SOCKET) { [newSocket release]; @throw [OFAcceptFailedException newWithClass: isa socket: self]; } @@ -397,12 +398,12 @@ #ifdef HAVE_THREADSAFE_GETADDRINFO 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 {