ObjFW  Diff

Differences From Artifact [4b99095be9]:

To Artifact [f24c3b3ba4]:


403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
	}

	if (port > 0)
		return port;

#ifndef __wii__
	addrLen = sizeof(addr.storage);
	if (getsockname(_socket, (struct sockaddr*)&addr, &addrLen)) {
		close(_socket);
		_socket = INVALID_SOCKET;
		@throw [OFBindFailedException exceptionWithHost: host
							   port: port
							 socket: self];
	}








|







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
	}

	if (port > 0)
		return port;

#ifndef __wii__
	addrLen = sizeof(addr.storage);
	if (getsockname(_socket, (struct sockaddr*)&addr.storage, &addrLen)) {
		close(_socket);
		_socket = INVALID_SOCKET;
		@throw [OFBindFailedException exceptionWithHost: host
							   port: port
							 socket: self];
	}

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithSocket: self];

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

	return of_address_to_string(_address, _addressLength);
}

- (bool)isListening
{
	return _listening;
}








|







502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotConnectedException exceptionWithSocket: self];

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

	return of_address_to_string_and_port(_address, _addressLength, NULL);
}

- (bool)isListening
{
	return _listening;
}