Differences From Artifact [1c776793df]:
- File
src/OFStreamSocket.m
— part of check-in
[28ea4a8a67]
at
2010-07-07 20:57:04
on branch trunk
— Rename OFSocket to OFStreamSocket.
This is to reflect that it is a connection-based, sequenced, reliable,
two-way byte stream. (user: js, size: 2343) [annotate] [blame] [check-ins using]
To Artifact [6a144d8c67]:
- File src/OFStreamSocket.m — part of check-in [d81629fead] at 2010-07-07 21:06:20 on branch trunk — Move most of the code for -[close] to OFStreamSocket. (user: js, size: 2594) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" #include <string.h> #include <fcntl.h> #include <errno.h> #ifndef _WIN32 # include <sys/types.h> # include <sys/socket.h> #endif #import "OFStreamSocket.h" #import "OFExceptions.h" #ifndef INVALID_SOCKET # define INVALID_SOCKET -1 #endif @implementation OFStreamSocket #ifdef _WIN32 + (void)initialize { WSADATA wsa; | > > > > > | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" #include <string.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #ifndef _WIN32 # include <sys/types.h> # include <sys/socket.h> #endif #import "OFStreamSocket.h" #import "OFExceptions.h" #ifndef INVALID_SOCKET # define INVALID_SOCKET -1 #endif #ifdef _WIN32 # define close(sock) closesocket(sock) #endif @implementation OFStreamSocket #ifdef _WIN32 + (void)initialize { WSADATA wsa; |
︙ | ︙ | |||
120 121 122 123 124 125 126 127 | #endif } - (int)fileDescriptor { return sock; } @end | > > > > > > > > > > > > | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | #endif } - (int)fileDescriptor { return sock; } - (void)close { if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; close(sock); sock = INVALID_SOCKET; eos = NO; listening = NO; } @end |