--- libaitrpc/inc/aitrpc.h 2011/08/29 23:26:56 1.3.2.1 +++ libaitrpc/inc/aitrpc.h 2011/08/30 11:13:29 1.3.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitrpc.h,v 1.3.2.1 2011/08/29 23:26:56 misho Exp $ +* $Id: aitrpc.h,v 1.3.2.3 2011/08/30 11:13:29 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -165,6 +165,7 @@ typedef struct { pthread_t cli_tid; // TID of thread void *cli_parent; // pointer to parent rpc_srv_t for server or to rpc_sess_t for client + int cli_netbuf; // size of network buffer size } rpc_cli_t; @@ -181,6 +182,7 @@ typedef struct tagBLOB { typedef struct { rpc_sess_t srv_session; // RPC session registration info int srv_numcli; // maximum concurent client connections + int srv_netbuf; // size of network buffer size rpc_cli_t srv_server; // RPC server socket rpc_cli_t *srv_clients; // connected rpc client sockets @@ -231,13 +233,14 @@ inline const char *rpc_GetError(); * @regProgID = ProgramID for authentication & recognition * @regProcID = ProcessID for authentication & recognition * @concurentClients = Concurent clients at same time to this server + * @netBuf = Network buffer length, if =0 == BUFSIZ (also meaning max RPC packet) * @family = Family type, AF_INET, AF_INET6 or AF_LOCAL * @csHost = Host name or address for bind server, if NULL any address * @Port = Port for bind server, if Port == 0 default port is selected * return: NULL == error or !=NULL bind and created RPC server instance */ rpc_srv_t *rpc_srv_initServer(u_int regProgID, u_int regProcID, int concurentClients, - u_short family, const char *csHost, u_short Port); + int netBuf, u_short family, const char *csHost, u_short Port); /* * rpc_srv_endServer() Destroy RPC server, close all opened sockets and free resources * @srv = RPC Server instance @@ -421,6 +424,8 @@ int rpc_srv_sendBLOB(rpc_cli_t * __restrict cli, rpc_b */ int rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_t * __restrict blob); +/* CLIENT part of functions */ + /* * rpc_cli_sendBLOB() Send BLOB to server * @cli = Client instance @@ -461,12 +466,13 @@ inline int rpc_cli_getBLOB(rpc_cli_t * __restrict cli, * rpc_cli_openClient() Connect to RPC Server * @ProgID = ProgramID for RPC session request * @ProcID = ProcessID for RPC session request + * @netBuf = Network buffer length, if =0 == BUFSIZ (also meaning max RPC packet) * @family = Family socket type, AF_INET or AF_INET6 * @csHost = Host name or IP address for bind server * @Port = Port for bind server, if Port == 0 default port is selected * return: NULL == error or !=NULL connection to RPC server established */ -rpc_cli_t *rpc_cli_openClient(u_int ProgID, u_int ProcID, +rpc_cli_t *rpc_cli_openClient(u_int ProgID, u_int ProcID, int netBuf, u_short family, const char *csHost, u_short Port); /* * rpc_cli_closeClient() Close connection to RPC server and free resources