J
j6vflbl6vy6g8o001
Sorry if this is really dumb, but I've searched for an example like
this and although can find many structures containing references back
to themselves, none with the additional complexities I see here.
I would really appreciate an explanation of what this is / is doing!
Thanks!
typedef struct SocketError {
int socketErrno;
unsigned short socketPort;
const char *message;
SocketError(const int n, const unsigned short q, const char *a)
{socketErrno = n; socketPort = q; message = a;}
};
And is used thusly:
try {
mySnmp = new SnmpSet(mib, sizeof(mib)/sizeof(MIB_T),
strSnmpHost, strSnmpPort, iSnmpInterval);
}
catch (SocketError *e)
{
cout << "Error connecting to SNMP" << endl;
cout << "errno = " << e->socketErrno << ", Port: " <<
e->socketPort;
cout << ", Message: " << e->message << endl;
return false;
}
Obviously I can sort of see what's going on, but an explanation,
specifically of what the "SocketError(param, param, param) {statement;
statement; statement;}" part is doing within the context of the
structure would really help!
Thanks in advance!
this and although can find many structures containing references back
to themselves, none with the additional complexities I see here.
I would really appreciate an explanation of what this is / is doing!
Thanks!
typedef struct SocketError {
int socketErrno;
unsigned short socketPort;
const char *message;
SocketError(const int n, const unsigned short q, const char *a)
{socketErrno = n; socketPort = q; message = a;}
};
And is used thusly:
try {
mySnmp = new SnmpSet(mib, sizeof(mib)/sizeof(MIB_T),
strSnmpHost, strSnmpPort, iSnmpInterval);
}
catch (SocketError *e)
{
cout << "Error connecting to SNMP" << endl;
cout << "errno = " << e->socketErrno << ", Port: " <<
e->socketPort;
cout << ", Message: " << e->message << endl;
return false;
}
Obviously I can sort of see what's going on, but an explanation,
specifically of what the "SocketError(param, param, param) {statement;
statement; statement;}" part is doing within the context of the
structure would really help!
Thanks in advance!