udp



Network UDP blocking sockets

Functions

1. udp::bind

Opens a listening socket on given port and interface.

Type definition

func(ip: string, port: int -> int)

List of arguments

Name Type Description
ip string Interface to listen to
port int Listening port

List of results

Name Type Description
- int Handle of a socket

2. udp::broadcast

Read bytes from file and sends them as a broadcast message.

Type definition

func(ip: string, port: int, file: int)

List of arguments

Name Type Description
port int Remote port
file int File handle

List of results

This function returns no results

3. udp::close

Unbinds and closes a socket.

Type definition

func(socket: int)

List of arguments

Name Type Description
socket int Socket handle

List of results

This function returns no results

4. udp::receive

Receives a stream from a socket adn saves it ot file.

Type definition

func(socket: int, file: int, timeout: int)

List of arguments

Name Type Description
socket int Socket handle
file int File handle
timeout int Read timeout

List of results

This function returns no results

5. udp::send

Read bytes from file and sends them to remote IP and port.

Type definition

func(ip: string, port: int, file: int)

List of arguments

Name Type Description
ip string Remote IP
port int Remote port
file int File handle

List of results

This function returns no results