324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
socket: self];
if (listen(sock, backlog) == -1)
@throw [OFListenFailedException newWithClass: isa
socket: self
backLog: backlog];
listening = YES;
}
- (void)listen
{
if (sock == INVALID_SOCKET)
@throw [OFNotConnectedException newWithClass: isa
socket: self];
if (listen(sock, 5) == -1)
@throw [OFListenFailedException newWithClass: isa
socket: self
backLog: 5];
listening = YES;
}
- (OFTCPSocket*)accept
{
OFTCPSocket *newsock;
struct sockaddr *addr;
socklen_t addrlen;
|
|
|
|
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
socket: self];
if (listen(sock, backlog) == -1)
@throw [OFListenFailedException newWithClass: isa
socket: self
backLog: backlog];
isListening = YES;
}
- (void)listen
{
if (sock == INVALID_SOCKET)
@throw [OFNotConnectedException newWithClass: isa
socket: self];
if (listen(sock, 5) == -1)
@throw [OFListenFailedException newWithClass: isa
socket: self
backLog: 5];
isListening = YES;
}
- (OFTCPSocket*)accept
{
OFTCPSocket *newsock;
struct sockaddr *addr;
socklen_t addrlen;
|
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
|
}
# endif
#endif
/* Get rid of a warning, never reached anyway */
assert(0);
}
- (void)close
{
[super close];
listening = NO;
[self freeMemory: sockAddr];
sockAddr = NULL;
sockAddrLen = 0;
}
@end
|
>
>
>
>
>
|
|
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
|
}
# endif
#endif
/* Get rid of a warning, never reached anyway */
assert(0);
}
- (BOOL)isListening
{
return isListening;
}
- (void)close
{
[super close];
isListening = NO;
[self freeMemory: sockAddr];
sockAddr = NULL;
sockAddrLen = 0;
}
@end
|