for connected embedded systems
![]() |
![]() |
![]() |
![]() |
ConnectServerInfo(), ConnectServerInfo_r()
Get information about a server connection
Synopsis:
#include <sys/neutrino.h>
int ConnectServerInfo( pid_t pid,
int coid,
struct _server_info* info );
int ConnectServerInfo_r( pid_t pid,
int coid,
struct _server_info* info );
Arguments:
- pid
- The process ID of the owner of the connection.
- coid
- The connection ID of the connection.
- info
- A pointer to a _server_info structure where the function can store information about the connection. For more information, see below.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The ConnectServerInfo() and ConnectServerInfo_r() kernel calls get information about the connection coid owned by process pid, and store it in the structure pointed to by info. If the process doesn't have a connection coid, the call scans for the next higher connection and returns it if present. Otherwise, -1 is returned. If you wish to check for the existence of an exact connection, you must compare the returned connection with the coid you requested.
These functions are identical except in the way they indicate errors. See the Returns section for details.
_server_info structure
The _server_info structure that info points to includes at least the following members:
- uint32_t nd
- The server's node ID.
- pid_t pid
- The server's process ID.
- int32_t chid
- The server's channel ID.
- int32_t scoid
- The server's connection ID.
uint32_t nd
The nd (node descriptor) is a temporary numeric description of a remote node. For more information, see the Qnet Networking chapter of the System Architecture guide.
| To: | Use this function: |
|---|---|
| Compare two nd objects | ND_NODE_CMP() |
| Convert a nd to text | netmgr_ndtostr() |
| Convert text to a nd | netmgr_strtond() |
Returns:
The only difference between these functions is the way they indicate errors:
- ConnectServerInfo()
- A matched coid. If an error occurs, the function returns -1 and sets errno.
- ConnectServerInfo_r()
- A matched coid. This function does NOT set errno. If an error occurs, the function returns the negative of a value from the Errors section.
Errors:
- EFAULT
- A fault occurred when the kernel tried to access the buffers provided.
- EINVAL
- Process pid doesn't have a connection >= coid.
- ESRCH
- The process indicated by pid doesn't exist.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
See also:
ConnectAttach(), ConnectClientInfo(), MsgInfo(), MsgReceivev(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)