version 1.2, 2011/05/02 23:12:07
|
version 1.2.4.5, 2011/08/19 09:20:46
|
Line 3
|
Line 3
|
#include <aitrpc.h> |
#include <aitrpc.h> |
|
|
|
|
|
#define sTYPE SOCK_STREAM |
|
|
|
|
int aaa(rpc_func_t *f, int in, rpc_val_t *iv) |
int aaa(rpc_func_t *f, int in, rpc_val_t *iv) |
{ |
{ |
rpc_blob_t *b; |
rpc_blob_t *b; |
Line 49 int BBB(rpc_func_t *f, int in, rpc_val_t *iv)
|
Line 52 int BBB(rpc_func_t *f, int in, rpc_val_t *iv)
|
rpc_srv_unregisterBLOB(f->func_parent, RPC_GET_BLOB(&iv[2])); |
rpc_srv_unregisterBLOB(f->func_parent, RPC_GET_BLOB(&iv[2])); |
|
|
|
|
rpc_srv_declValsCall(f, 4); | rpc_srv_allocVars(f, 4); |
rpc_srv_getValsCall(f, &v); | rpc_srv_getVars(f, &v); |
RPC_SET_BUF(&v[0], "00!oo", 6); |
RPC_SET_BUF(&v[0], "00!oo", 6); |
RPC_SET_I8(&v[1], 65); |
RPC_SET_I8(&v[1], 65); |
RPC_SET_STR(&v[2], "Oho boho i cheburashka"); |
RPC_SET_STR(&v[2], "Oho boho i cheburashka"); |
Line 82 int main()
|
Line 85 int main()
|
pthread_t tid[2]; |
pthread_t tid[2]; |
int ret; |
int ret; |
|
|
srv = rpc_srv_initServer(100, 2, 1, 2, "0.0.0.0", 11111); | srv = rpc_srv_initServer(100, 2, 1, sTYPE, AF_INET, "0.0.0.0", 11111); |
if (!srv) { |
if (!srv) { |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
return 1; |
return 1; |
} |
} |
|
|
if (rpc_srv_initBLOBServer(srv, 0, "/tmp")) { | if (rpc_srv_initBLOBServer(srv, sTYPE, 0, "/tmp")) { |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
return 1; |
return 1; |
} |
} |
Line 112 int main()
|
Line 115 int main()
|
rpc_srv_execServer(srv); |
rpc_srv_execServer(srv); |
} |
} |
|
|
|
rpc_srv_endBLOBServer(srv); |
rpc_srv_endServer(srv); |
rpc_srv_endServer(srv); |
return 0; |
return 0; |
} |
} |