IP_ListenToService

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `IP_ListenToService`

`IP_ListenToService` -- like `IP_ListenToPort`, but uses the service name.

## Syntax

``int IP_ListenToService`(char* service, int backlog);`

## Arguments

`service`

  The service name, as found in `/etc/services`.

`backlog`

  The number of connection requests that are allowed to be simultaneously pending.

## Returns

The file descriptor (socket), or -1 and `errno` is set.

## Description

This function wraps the `listen` library call, and registers the resulting file descriptor with the `IP_Receive` function. Prior to calling `listen`, this function looks up the service name to produce a port number which is given to `IP_ListenToPort`.

## See Also

Working with TCP/IP, `IP_ListenToPort`, `IP_ConnectToService`

Prev | Home | Next
`IP_ListenToPort` | Up | `IP_MsgCascade`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.