FreeCalypso > hg > fc-tourmaline
comparison src/g23m-fad/tcpip/rnet/rnet_rt/rnet_rt_api_listen.c @ 1:fa8dc04885d8
src/g23m-*: import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:25:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:4e78acac3d88 | 1:fa8dc04885d8 |
---|---|
1 /** | |
2 * @file rnet_rt_api_listen.c | |
3 * | |
4 * RNET_RT API | |
5 * | |
6 * @author Regis Feneon | |
7 * @version 0.1 | |
8 */ | |
9 | |
10 /* | |
11 * $Id: rnet_rt_api_listen.c,v 1.3 2002/10/30 15:23:34 rf Exp $ | |
12 * $Name: ti_20021030 $ | |
13 * | |
14 * History: | |
15 * | |
16 * Date Author Modification | |
17 * -------------------------------------------------- | |
18 * 3/22/2002 Regis Feneon Create | |
19 * | |
20 * (C) Copyright 2002 by TI, All Rights Reserved | |
21 * | |
22 */ | |
23 | |
24 #include "rnet_cfg.h" | |
25 #ifdef RNET_CFG_REAL_TRANSPORT | |
26 | |
27 #include "rnet_rt_i.h" | |
28 #include "rnet_rt_env.h" | |
29 | |
30 /** | |
31 * Commands a connection to start listening for incoming connections. | |
32 * When an incoming connection is accepted, an RNET_ACCEPTED message is sent. | |
33 * The connection ID will have to be bound to a local port | |
34 * with the rnet_bind() function. | |
35 * | |
36 * Note that there is no accept function: After a call to listen, | |
37 * the application can receive RNET_ACCEPTED messages. | |
38 * | |
39 * @param desc Connection identifier [IN]. | |
40 * @return RNET_MEMORY_ERR No available memory for the listening connection. | |
41 * RNET_NOT_INITIALIZED NET subsystem not initialized (internal error). | |
42 * RNET_INTERNAL_ERR Network subsystem failed. | |
43 * or No more socket descriptors available. | |
44 * RNET_INVALID_PARAMETER Invalid connection ID. | |
45 * or Connection not bound with bind. | |
46 * or The ID does not support listening operation. | |
47 * RNET_IN_USE Connection already connected. | |
48 * RNET_NOT_READY Still processing a callback function. | |
49 * RNET_OK Listening successfully started. | |
50 */ | |
51 | |
52 T_RNET_RET rnet_rt_listen (T_RNET_DESC *desc) | |
53 { | |
54 int err; | |
55 | |
56 /* listen for connections */ | |
57 rvf_lock_mutex( &rnet_rt_env_ctrl_blk_p->mutex); | |
58 err = ngSAIOListen( (NGsock *) desc, RNET_RT_SOCK_LISTEN_MAX); | |
59 rvf_unlock_mutex( &rnet_rt_env_ctrl_blk_p->mutex); | |
60 | |
61 return( rnet_rt_ngip_error( err)); | |
62 } | |
63 | |
64 #endif /* ifdef RNET_CFG_REAL_TRANSPORT */ | |
65 |