udpClose()

Closes the connection to a UDP socket.

Synopsis

int udpClose(int socket);

Parameters

Parameter Description
socket Number of the socket

Return value

0 if OK, otherwise -1. Errors can be retrieved with getLastError().

Error

Missing or wrong arguments.

Description

Closes the connection to a UDP socket.

Example

main()
{
  int read, open, close;
  time maxTime;
  string data;
  time maxTime = 100;
  unsigned openPort, writePort;
  string writeHost;
  openPort = 120;
  open = udpOpen("eiwnt094", openPort);
  DebugN(open);
  read = udpRead(open, data, writeHost, writePort, maxTime);
  DebugN(data, writeHost, writePort);
  close = udpClose(open);
  DebugN(close);
}

Assignment

Communication functions

Availability

CTRL