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

Implements OP_SOCK_SEND to transmit data over a connected socket. More...

Go to the source code of this file.

Functions

 free_value (datav)
 free_value (fdv)
 push_value (vm, make_int(sent))

Variables

case OP_SOCK_SEND
Value fdv = pop_value(vm)
int sent = -1
 break

Detailed Description

Implements OP_SOCK_SEND to transmit data over a connected socket.

Behavior:

  • Pops data (string) and a socket file descriptor (int) and pushes the number of bytes sent (>=0) or -1 on error.
  • On non-UNIX platforms, pushes -1 (unsupported) without sending.

Errors:

  • If argument types are wrong, prints an error, frees values, and pushes -1.

Definition in file socket_send.c.

Function Documentation

◆ free_value() [1/2]

free_value(datav)

◆ free_value() [2/2]

free_value(fdv)

◆ push_value()

push_value(vm,
make_int(sent) )

Variable Documentation

◆ break

break

Definition at line 47 of file socket_send.c.

◆ fdv

Value fdv = pop_value(vm)

Definition at line 25 of file socket_send.c.

◆ OP_SOCK_SEND

case OP_SOCK_SEND

Definition at line 22 of file socket_send.c.

◆ sent

int sent = -1

Definition at line 26 of file socket_send.c.