331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
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 *newSocket;
struct sockaddr_storage *addr;
socklen_t addrLen;
|
|
|
|
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
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 *newSocket;
struct sockaddr_storage *addr;
socklen_t addrLen;
|
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
/* 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
|
|
|
|
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
/* Get rid of a warning, never reached anyway */
assert(0);
}
- (BOOL)isListening
{
return listening;
}
- (void)close
{
[super close];
listening = NO;
[self freeMemory: sockAddr];
sockAddr = NULL;
sockAddrLen = 0;
}
@end
|