---
name: "socket_fastopen"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/socket_fastopen"
---

# socket\_fastopen(3)

enable TCP Fast Open on a server-side TCP socket

## NAME

socket\_fastopen - enable TCP Fast Open on a server-side TCP socket

## SYNTAX

**#include \<libowfat/socket.h\>**

int **socket\_fastopen**(int *s*);

## DESCRIPTION

socket\_fastopen enables TCP Fast Open support on a server-side TCP socket.  Call this before socket\_listen().  If the platform does not support this functionality, returns -1 and sets errno to ENOPROTOOPT (or ENOSYS if the platform does not define ENOPROTOOPT).

Normally socket\_fastopen returns 0. If anything goes wrong, socket\_fastopen returns -1, setting errno appropriately.

## EXAMPLE

  \#include \<libowfat/socket.h\>

  int *s*;\
   char *ip*\[4\];\
   uint16 *p*;

  *s* = socket\_tcp4b();\
   socket\_fastopen(s);\
   socket\_bind4\_reuse(s,ip,p);\
   socket\_listen(16);

## SEE ALSO

[socket\_fastopen\_connect4(3)](/socket_fastopen_connect4/3.md), [socket\_fastopen\_connect6(3)](/socket_fastopen_connect6/3.md)
