ObjFW  Diff

Differences From Artifact [596449d526]:

To Artifact [7dca3c8c74]:


44
45
46
47
48
49
50

51
52
53
54
55
56
57
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58







+







#import "OFConnectionFailedException.h"
#import "OFGetOptionFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFListenFailedException.h"
#import "OFNotImplementedException.h"
#import "OFNotOpenException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"
#import "OFSetOptionFailedException.h"

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

/* References for static linking */
597
598
599
600
601
602
603
604

605
606
607
608
609
610
611




612


613
614

615
616
617
618
619
620
621
598
599
600
601
602
603
604

605
606
607
608
609
610
611
612
613
614
615
616

617
618
619

620
621
622
623
624
625
626
627







-
+







+
+
+
+
-
+
+

-
+







	[OFRunLoop of_addAsyncAcceptForTCPSocket: self
					   block: block];
}
#endif

- (OFString *)remoteAddress
{
	OFString *ret;
	of_socket_address_t address;

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

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

	if (_addressLength > sizeof(address.address))
		@throw [OFOutOfRangeException exception];

	memset(&address, '\0', sizeof(address));
	of_address_to_string_and_port(_address, _addressLength, &ret, NULL);
	memcpy(&address.address, _address, _addressLength);
	address.length = _addressLength;

	return ret;
	return of_socket_address_ip_string(&address, NULL);
}

- (bool)isListening
{
	return _listening;
}