Changeset 14f1db0 in mainline for uspace/lib/socket/generic/net_modules.c
- Timestamp:
- 2010-04-09T12:54:57Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1caa3c2
- Parents:
- 24ab58b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/socket/generic/net_modules.c
r24ab58b3 r14f1db0 77 77 } 78 78 79 int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver){ 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 { 80 94 return bind_service_timeout(need, arg1, arg2, arg3, client_receiver, 0); 81 95 } 82 96 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){ 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 { 84 115 ERROR_DECLARE; 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))){ 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))) { 95 124 ipc_hangup(phone); 96 125 return ERROR_CODE; … … 98 127 async_new_connection(phonehash, 0, NULL, client_receiver); 99 128 } 129 100 130 return phone; 101 131 }
Note:
See TracChangeset
for help on using the changeset viewer.