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

Implements OP_SOCK_TCP_LISTEN to create a TCP listening socket. More...

Go to the source code of this file.

Functions

 free_value (backlogv)
 free_value (portv)
 push_value (vm, make_int(fd > 0 ? fd :0))

Variables

case OP_SOCK_TCP_LISTEN
Value portv = pop_value(vm)
int fd = 0
 break

Detailed Description

Implements OP_SOCK_TCP_LISTEN to create a TCP listening socket.

Behavior:

  • Pops port (int); creates a listening socket bound to INADDR_ANY; pushes fd (>0) on success 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_listen.c.

Function Documentation

◆ free_value() [1/2]

free_value(backlogv)

◆ free_value() [2/2]

free_value(portv)

◆ push_value()

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

Variable Documentation

◆ break

break

Definition at line 61 of file socket_tcp_listen.c.

◆ fd

void fd = 0

Definition at line 25 of file socket_tcp_listen.c.

◆ OP_SOCK_TCP_LISTEN

case OP_SOCK_TCP_LISTEN

Definition at line 21 of file socket_tcp_listen.c.

◆ portv

Value portv = pop_value(vm)

Definition at line 24 of file socket_tcp_listen.c.