Index: src/OFSocket.h ================================================================== --- src/OFSocket.h +++ src/OFSocket.h @@ -53,6 +53,17 @@ /** * Enables/disables non-blocking I/O. */ - setBlocking: (BOOL)enable; + +- connectToService: (OFString*)service + onNode: (OFString*)node; +- bindService: (OFString*)service + onNode: (OFString*)node + withFamily: (int)family; +- listenWithBackLog: (int)backlog; +- listen; +- (OFSocket*)accept; +- enableKeepAlives: (BOOL)enable; +- close; @end Index: src/OFSocket.m ================================================================== --- src/OFSocket.m +++ src/OFSocket.m @@ -119,6 +119,51 @@ @throw [OFSetOptionFailedException newWithClass: isa]; #endif return self; } + +- connectToService: (OFString*)service + onNode: (OFString*)node +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- bindService: (OFString*)service + onNode: (OFString*)node + withFamily: (int)family +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- listenWithBackLog: (int)backlog +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- listen +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- (OFSocket*)accept +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- enableKeepAlives: (BOOL)enable +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- close +{ + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} @end Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -50,11 +50,11 @@ /** * Accept an incoming connection. * \return An autoreleased OFTCPSocket for the accepted connection. */ -- (OFTCPSocket*)accept; +- (OFSocket*)accept; /** * Enable or disable keep alives for the connection. */ - enableKeepAlives: (BOOL)enable; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -268,11 +268,11 @@ andBackLog: 5]; return self; } -- (OFTCPSocket*)accept +- (OFSocket*)accept { OFTCPSocket *newsock; struct sockaddr *addr; socklen_t addrlen; int s; Index: tests/OFTCPSocket/OFTCPSocket.m ================================================================== --- tests/OFTCPSocket/OFTCPSocket.m +++ tests/OFTCPSocket/OFTCPSocket.m @@ -38,13 +38,13 @@ OFString *service; srand(time(NULL)); @try { - OFTCPSocket *server = [OFTCPSocket socket]; - OFTCPSocket *client = [OFTCPSocket socket]; - OFTCPSocket *accepted; + OFSocket *server = [OFTCPSocket socket]; + OFSocket *client = [OFTCPSocket socket]; + OFSocket *accepted; char buf[7]; puts("== IPv4 =="); port = get_port(); service = [OFString stringWithFormat: @"%d", port];