File: simple_server.h

package info (click to toggle)
spiped 1.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,328 kB
  • sloc: ansic: 11,951; sh: 1,081; makefile: 629; perl: 121
file content (17 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef SIMPLE_SERVER_H_
#define SIMPLE_SERVER_H_

#include <stddef.h>
#include <stdint.h>

/**
 * simple_server(addr, nconn_max, shutdown_after, callback, caller_cookie):
 * Run a server which accepts up to ${nconn_max} connections to socket
 * ${addr}.  After receiving a message, call ${callback} and pass it the
 * ${caller_cookie}, along with the message.  Automatically shut down
 * after ${shutdown_after} connections have been dropped.
 */
int simple_server(const char *, size_t, size_t, int (*)(void *, uint8_t *,
    size_t, int), void *);

#endif /* !SIMPLE_SERVER_H_ */