128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
if ((he = gethostbyname([host cString])) == NULL) {
# ifdef OF_THREADS
[addrlist release];
[mutex unlock];
# endif
@throw [OFAddressTranslationFailedException newWithClass: isa
host: host];
}
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = of_bswap16_if_le(port);
|
>
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
if ((he = gethostbyname([host cString])) == NULL) {
# ifdef OF_THREADS
[addrlist release];
[mutex unlock];
# endif
@throw [OFAddressTranslationFailedException newWithClass: isa
socket: self
host: host];
}
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = of_bswap16_if_le(port);
|
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
[mutex unlock];
# endif
@throw [OFAddressTranslationFailedException newWithClass: isa
socket: self
host: host];
}
memcpy(addr.in.sin_addr.s_addr, he->h_addr_list[0], he->h_length);
# ifdef OF_THREADS
[mutex unlock];
# endif
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
@throw [OFBindFailedException newWithClass: isa
socket: self
|
|
|
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
[mutex unlock];
# endif
@throw [OFAddressTranslationFailedException newWithClass: isa
socket: self
host: host];
}
memcpy(&addr.in.sin_addr.s_addr, he->h_addr_list[0], he->h_length);
# ifdef OF_THREADS
[mutex unlock];
# endif
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
@throw [OFBindFailedException newWithClass: isa
socket: self
|