Hi , im tryin to write simple program for subscriber management on SCE 8000, here is my code:
<code>
#include "SmApiBlocking.h"
#include <stdio.h>
int main(int argc, char* argv[]){
char* sce_ip = argv[1];
char* sid = argv[2];
char* package_id = argv[3];
char* prop_type = "packageId";
int status = 1;
SmApiBlocking bapi;
//initiation
int con = bapi.init(10,
0,
2000000, //default
10, //default
5, //default
1);
bapi.setReplyTimeout(30); //set timeout for 5 minutes
bapi.connect(sce_ip); // connect to the SM
if ( bapi.subscriberLoggedIn(sid)->u.boolVal == true){
ReturnCode* op_status = bapi.login(
sid,
NULL, NULL, 0,
&prop_type, // property key
&package_id, // property value
1, // one property
NULL, // domain
true,
-1
);
if (isReturnCodeError(op_status) == true){
printf("%d\n", op_status->u.errorCode->type);
printf("%s\n", op_status->u.errorCode->message);
}else{
status = 0;
}
freeReturnCode (op_status);
}else{
printf("%s", "No such subscriber\n");
}
//finalization
bapi.disconnect();
return status;
}
</code>
its working nice when SM server is reachable , but when its not - timeout on connection method dont work and application blocking forever.
Maybe someone can give some suggestions.