| | |
| | | return sockt->recvfrom_nowait(buf, size, port); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 如果建立连接的节点没有接受到消息会一直等待 |
| | | * 向node_arr 中的所有网络节点发送请求消息,节点的返回信息汇总并存储在recv_arr中 |
| | | * @node_arr 网络节点组, @node_arr_len该数组长度 |
| | | * @send_buf 发送的消息,@send_size 该消息体的长度 |
| | | * @recv_arr 返回的应答消息组,@recv_arr_size 该数组长度 |
| | | * @return 成功发送的节点的个数 |
| | | * 优点:1某个节点的故障不会阻塞其他节点。2性能好 |
| | | * 缺点:不是线程安全的, 即不能有两个以上的线程同时使用这个对象的方法 |
| | | */ |
| | | |
| | | |
| | | //***************************************************************************** |
| | | // |
| | | //! \brief Write one byte to special register |
| | | //! |
| | | //! This function is to write one byte to LIS302DL register,one byte will be |
| | | //! writen in appointed address. |
| | | //! |
| | | //! \param node_arr specifies the target register address. |
| | | //! \param send_buf is the data written to target register. |
| | | //! |
| | | //! \return Indicate the status of operation which can be one of the following |
| | | //! value \b SUCCESS or \b FAILURE . |
| | | //! |
| | | //! \note This function is used by internal, user MUST NOT call it in your |
| | | //! Application. |
| | | // |
| | | //***************************************************************************** |
| | | int net_mod_socket_sendandrecv(void *_socket, net_node_t *node_arr, int arrlen, void *send_buf, int send_size, |
| | | net_mod_recv_msg_t ** recv_arr, int *recv_arr_size){ |
| | | NetModSocket *sockt = (NetModSocket *)_socket; |