ObjFW  Diff

Differences From Artifact [c20d586426]:

To Artifact [9ed6a2db34]:


1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591

	return description;
}
@end

@implementation OFAddressTranslationFailedException
+ newWithClass: (Class)class_
	  node: (OFString*)node
       service: (OFString*)service
{
	return [[self alloc] initWithClass: class_
				      node: node
				   service: service];
}

- initWithClass: (Class)class_
{
	self = [super initWithClass: class_];

	errNo = GET_AT_ERRNO;

	return self;
}

- initWithClass: (Class)class_
	   node: (OFString*)node_
	service: (OFString*)service_
{
	self = [super initWithClass: class_];

	@try {
		node	= [node_ copy];
		service = [service_ copy];
		errNo	= GET_AT_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[node release];
	[service release];

	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	if (node != nil && service != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The service %@ on %@ could not be translated to an "
		    @"address in class %s. This means that either the node was "
		    @"not found, there is no such service on the node, there "
		    @"was a problem with the name server, there was a problem "
		    @"with your network connection or you specified an invalid "
		    @"node or service. " ERRFMT, service, node,
		    class_getName(inClass), AT_ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"An address translation failed in class %s! " ERRFMT,
		    class_getName(inClass), AT_ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)node
{
	return node;
}

- (OFString*)service
{
	return service;
}
@end

@implementation OFConnectionFailedException
+ newWithClass: (Class)class_
	  node: (OFString*)node
       service: (OFString*)service
{
	return [[self alloc] initWithClass: class_
				      node: node
				   service: service];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	   node: (OFString*)node_
	service: (OFString*)service_
{
	self = [super initWithClass: class_];

	@try {
		node	= [node_ copy];
		service	= [service_ copy];
		errNo	= GET_SOCK_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[node release];
	[service release];

	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A connection to service %@ on node %@ could not be established "
	    @"in class %s! " ERRFMT, service, node, class_getName(inClass),
	    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)node
{
	return node;
}

- (OFString*)service
{
	return service;
}
@end

@implementation OFBindFailedException
+ newWithClass: (Class)class_
	  node: (OFString*)node
       service: (OFString*)service
{
	return [[self alloc] initWithClass: class_
				      node: node
				   service: service];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	   node: (OFString*)node_
	service: (OFString*)service_
{
	self = [super initWithClass: class_];

	@try {
		node	= [node_ copy];
		service	= [service_ copy];
		errNo	= GET_SOCK_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[node release];
	[service release];

	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Binding service %@ on node %@ failed in class %s! " ERRFMT,
	    service, node, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)node
{
	return node;
}

- (OFString*)service
{
	return service;
}
@end

@implementation OFListenFailedException
+ newWithClass: (Class)class_
       backLog: (int)backlog
{







|
<


|
<












|
<




|
<
|










|
<









|

|
|
<
|
|
|
|













|

|
<
<
<
<
<





|
|


|
|











|
|




|
|
|










|
<










|
|










|

|


|

|





|
|


|
|











|
|




|
|
|










|
<










|
|









|

|


|

|







1355
1356
1357
1358
1359
1360
1361
1362

1363
1364
1365

1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378

1379
1380
1381
1382
1383

1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395

1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408

1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428





1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470

1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542

1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578

	return description;
}
@end

@implementation OFAddressTranslationFailedException
+ newWithClass: (Class)class_
	  host: (OFString*)host

{
	return [[self alloc] initWithClass: class_
				      host: host];

}

- initWithClass: (Class)class_
{
	self = [super initWithClass: class_];

	errNo = GET_AT_ERRNO;

	return self;
}

- initWithClass: (Class)class_
	   host: (OFString*)host_

{
	self = [super initWithClass: class_];

	@try {
		host  = [host_ copy];

		errNo = GET_AT_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[host release];


	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	if (host != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The host %@ could not be translated to an address in "
		    @"class %s. This means that either the host was not found, "

		    @"there was a problem with the name server, there was a "
		    @"problem with your network connection or you specified an "
		    @"invalid host. " ERRFMT, host, class_getName(inClass),
		    AT_ERRPARAM];
	else
		description = [[OFString alloc] initWithFormat:
		    @"An address translation failed in class %s! " ERRFMT,
		    class_getName(inClass), AT_ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)host
{
	return host;





}
@end

@implementation OFConnectionFailedException
+ newWithClass: (Class)class_
	  host: (OFString*)host
	  port: (uint16_t)port
{
	return [[self alloc] initWithClass: class_
				      host: host
				      port: port];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	   host: (OFString*)host_
	   port: (uint16_t)port_
{
	self = [super initWithClass: class_];

	@try {
		host  = [host_ copy];
		port  = port_;
		errNo = GET_SOCK_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[host release];


	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"A connection to %@ on port %" @PRIu16 @"could not be established "
	    @"in class %s! " ERRFMT, host, port, class_getName(inClass),
	    ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)host
{
	return host;
}

- (uint16_t)port
{
	return port;
}
@end

@implementation OFBindFailedException
+ newWithClass: (Class)class_
	  host: (OFString*)host
	  port: (uint16_t)port
{
	return [[self alloc] initWithClass: class_
				      host: host
				      port: port];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	   host: (OFString*)host_
	   port: (uint16_t)port_
{
	self = [super initWithClass: class_];

	@try {
		host  = [host_ copy];
		port  = port_;
		errNo = GET_SOCK_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[host release];


	[super dealloc];
}

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"Binding to port %" @PRIu16 @" on host %@ failed in class %s! "
	    ERRFMT, port, host, class_getName(inClass), ERRPARAM];

	return description;
}

- (int)errNo
{
	return errNo;
}

- (OFString*)host
{
	return host;
}

- (uint16_t)port
{
	return port;
}
@end

@implementation OFListenFailedException
+ newWithClass: (Class)class_
       backLog: (int)backlog
{