Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
socket_tcp_accept.c File Reference

Implements OP_SOCK_TCP_ACCEPT to accept an incoming TCP connection. More...

Go to the source code of this file.

Functions

 free_value (fdv)
 push_value (vm, make_int(client > 0 ? client :0))

Variables

case OP_SOCK_TCP_ACCEPT
int client = 0
 break

Detailed Description

Implements OP_SOCK_TCP_ACCEPT to accept an incoming TCP connection.

Behavior:

  • Pops listening socket fd (int); accepts one connection; pushes new client fd (>0) or 0.

Errors:

  • On wrong type or OS errors, prints an error and pushes 0. Non-UNIX platforms return 0.

Definition in file socket_tcp_accept.c.

Function Documentation

◆ free_value()

free_value(fdv)

◆ push_value()

push_value(vm,
make_int(client > 0 ? client :0) )

Variable Documentation

◆ break

break

Definition at line 38 of file socket_tcp_accept.c.

◆ client

int client = 0

Definition at line 24 of file socket_tcp_accept.c.

◆ OP_SOCK_TCP_ACCEPT

case OP_SOCK_TCP_ACCEPT

Definition at line 21 of file socket_tcp_accept.c.