---
name: "ixp_serverloop"
section: "3"
platform: "linux"
package: "libixp-dev"
version: "0.6~20121202+hg148-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/ixp_serverloop"
---

# ixp\_serverloop(3)

## NAME

ixp\_serverloop, IxpServer

## SYNOPSIS

```
#include <ixp.h>
int ixp_serverloop(IxpServer *srv);
typedef struct IxpServer IxpServer;
struct IxpServer {
        IxpConn*        conn;
        IxpMutex        lk;
        IxpTimer*       timer;
        void            (*preselect)(IxpServer*);
        void*           aux;
        int             running;
        int             maxfd;
        fd_set          rd;
}
```

## DESCRIPTION

Enters the main loop of the server. Exits when *srv*-\>running becomes false, or when [select(2)](/select/2.md) returns an error other than EINTR.

## RETURN VALUE

Returns 0 when the loop exits normally, and 1 when it exits on error. **[errno(3)](/errno/3.md)** or the return value of **[ixp\_errbuf(3)](/ixp_errbuf/3.md)** may be inspected.

## SEE ALSO

[ixp\_listen(3)](/ixp_listen/3.md), [ixp\_settimer(3)](/ixp_settimer/3.md)
