ObjFW  Diff

Differences From Artifact [43965236bf]:

To Artifact [12ce6e353d]:


37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
#import "OFAcceptFailedException.h"
#import "OFAlreadyConnectedException.h"
#import "OFBindFailedException.h"
#import "OFConnectionFailedException.h"
#import "OFGetOptionFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFListenFailedException.h"
#import "OFNotConnectedException.h"
#import "OFNotImplementedException.h"

#import "OFOutOfMemoryException.h"
#import "OFSetOptionFailedException.h"

#import "socket.h"
#import "socket_helpers.h"
#import "resolver.h"








<

>







37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
#import "OFAcceptFailedException.h"
#import "OFAlreadyConnectedException.h"
#import "OFBindFailedException.h"
#import "OFConnectionFailedException.h"
#import "OFGetOptionFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFListenFailedException.h"

#import "OFNotImplementedException.h"
#import "OFNotOpenException.h"
#import "OFOutOfMemoryException.h"
#import "OFSetOptionFailedException.h"

#import "socket.h"
#import "socket_helpers.h"
#import "resolver.h"

479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
{
	[self listenWithBackLog: SOMAXCONN];
}

- (void)listenWithBackLog: (int)backLog
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithSocket: self];

	if (listen(_socket, backLog) == -1)
		@throw [OFListenFailedException
		    exceptionWithSocket: self
				backLog: backLog
				  errNo: of_socket_errno()];








|







479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
{
	[self listenWithBackLog: SOMAXCONN];
}

- (void)listenWithBackLog: (int)backLog
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (listen(_socket, backLog) == -1)
		@throw [OFListenFailedException
		    exceptionWithSocket: self
				backLog: backLog
				  errNo: of_socket_errno()];

564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
#endif

- (OFString*)remoteAddress
{
	OFString *ret;

	if (_socket == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithSocket: self];

	if (_address == NULL)
		@throw [OFInvalidArgumentException exception];

	of_address_to_string_and_port(_address, _addressLength, &ret, NULL);

	return ret;







|







564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
#endif

- (OFString*)remoteAddress
{
	OFString *ret;

	if (_socket == INVALID_SOCKET)
		@throw [OFNotOpenException exceptionWithObject: self];

	if (_address == NULL)
		@throw [OFInvalidArgumentException exception];

	of_address_to_string_and_port(_address, _addressLength, &ret, NULL);

	return ret;