Changes in uspace/lib/socket/generic/net_modules.c [14f1db0:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/socket/generic/net_modules.c
r14f1db0 r849ed54 77 77 } 78 78 79 /** Create bidirectional connection with the needed module service and registers the message receiver. 80 * 81 * @param[in] need The needed module service. 82 * @param[in] arg1 The first parameter. 83 * @param[in] arg2 The second parameter. 84 * @param[in] arg3 The third parameter. 85 * @param[in] client_receiver The message receiver. 86 * 87 * @return The phone of the needed service. 88 * @return Other error codes as defined for the ipc_connect_to_me() function. 89 * 90 */ 91 int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, 92 async_client_conn_t client_receiver) 93 { 79 int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver){ 94 80 return bind_service_timeout(need, arg1, arg2, arg3, client_receiver, 0); 95 81 } 96 82 97 /** Create bidirectional connection with the needed module service and registers the message receiver. 98 * 99 * @param[in] need The needed module service. 100 * @param[in] arg1 The first parameter. 101 * @param[in] arg2 The second parameter. 102 * @param[in] arg3 The third parameter. 103 * @param[in] client_receiver The message receiver. 104 * @param[in] timeout The connection timeout in microseconds. 105 * No timeout if set to zero (0). 106 * 107 * @return The phone of the needed service. 108 * @return ETIMEOUT if the connection timeouted. 109 * @return Other error codes as defined for the ipc_connect_to_me() function. 110 * 111 */ 112 int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, 113 ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout) 114 { 83 int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout){ 115 84 ERROR_DECLARE; 116 117 /* Connect to the needed service */ 118 int phone = connect_to_service_timeout(need, timeout); 119 if (phone >= 0) { 120 /* Request the bidirectional connection */ 121 ipcarg_t phonehash; 122 if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3, 123 &phonehash))) { 85 86 int phone; 87 ipcarg_t phonehash; 88 89 // connect to the needed service 90 phone = connect_to_service_timeout(need, timeout); 91 // if connected 92 if(phone >= 0){ 93 // request the bidirectional connection 94 if(ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash))){ 124 95 ipc_hangup(phone); 125 96 return ERROR_CODE; … … 127 98 async_new_connection(phonehash, 0, NULL, client_receiver); 128 99 } 129 130 100 return phone; 131 101 }
Note:
See TracChangeset
for help on using the changeset viewer.