29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#import "OFExceptions.h"
#import "OFString.h"
#import "OFTCPSocket.h"
#ifndef _WIN32
# include <errno.h>
# define GET_ERR errno
# ifndef HAVE_GETADDRINFO
# define GET_AT_ERR h_errno
# else
# define GET_AT_ERR errno
# endif
# define GET_SOCK_ERR errno
# define ERRFMT "Error string was: %s"
# define ERRPARAM strerror(err)
# ifndef HAVE_GETADDRINFO
# define AT_ERRPARAM hstrerror(err)
# else
# define AT_ERRPARAM strerror(err)
# endif
#else
# include <windows.h>
# define GET_ERR GetLastError()
|
|
|
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#import "OFExceptions.h"
#import "OFString.h"
#import "OFTCPSocket.h"
#ifndef _WIN32
# include <errno.h>
# define GET_ERR errno
# ifndef HAVE_THREADSAFE_GETADDRINFO
# define GET_AT_ERR h_errno
# else
# define GET_AT_ERR errno
# endif
# define GET_SOCK_ERR errno
# define ERRFMT "Error string was: %s"
# define ERRPARAM strerror(err)
# ifndef HAVE_THREADSAFE_GETADDRINFO
# define AT_ERRPARAM hstrerror(err)
# else
# define AT_ERRPARAM strerror(err)
# endif
#else
# include <windows.h>
# define GET_ERR GetLastError()
|
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
|
return [[self alloc] initWithClass: class__
node: node_
service: service_];
}
- initWithClass: (Class)class__
{
@throw [OFNotImplementedException newWithClass: isa
selector: _cmd];
}
- initWithClass: (Class)class__
node: (OFString*)node_
service: (OFString*)service_
{
self = [super initWithClass: class__];
|
>
|
>
|
>
|
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
|
return [[self alloc] initWithClass: class__
node: node_
service: service_];
}
- initWithClass: (Class)class__
{
self = [super initWithClass: class__];
err = GET_AT_ERR;
return self;
}
- initWithClass: (Class)class__
node: (OFString*)node_
service: (OFString*)service_
{
self = [super initWithClass: class__];
|
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
|
}
- (OFString*)string
{
if (string != nil)
return string;
string = [[OFString alloc] initWithFormat:
@"The service %s on %s 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 cString], [node cString], [class_ className], AT_ERRPARAM];
return string;
}
- (int)errNo
{
return err;
|
>
|
|
|
|
|
>
|
|
>
>
>
>
|
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
|
}
- (OFString*)string
{
if (string != nil)
return string;
if (node != nil && service != nil)
string = [[OFString alloc] initWithFormat:
@"The service %s on %s 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 cString],
[node cString], [class_ className], AT_ERRPARAM];
else
string = [[OFString alloc] initWithFormat:
@"An address translation failed in class %s! " ERRFMT,
[class_ className], AT_ERRPARAM];
return string;
}
- (int)errNo
{
return err;
|