Please enable JavaScript to view this site.

Function for opening a server-type UDP communication.

The server remains listening for messages from several stations and responds to each of them if necessary. Listening occurs on the local port specified by nPort and can be limited to the local interface specified by nAddr or extended to all local interfaces.

Syntax

i32 udp_open_server (u32 nPort [, i32 nAddr=ALL])

nPort

Number of the (local) port on which the server is listening

nAddr

IP (local) address of the interface on which the server is listening. (optional, default to all local interfaces)

Result

Returns:

Value

Meaning

0-:-99

Operation performed successfully. The communication ID is returned

-1

Illegal nPort

-3

All task connection table entries are already committed, impossible to establish a new connection (max 10 connections)

-1000 -:- -2000

Socket opening failed: returns the code provided by the S.O. socket() function, with offset 1000

-2000 -:- -3000

S.O. function bind() failed: returns the code provided by bind(), with offset 2000

To see some returned errors more specifically, see Returned errors table

Validity

Rule, Task

Note

If the result is negative, it should not be used in the other UDP communication handling functions

For a concrete example see in RDE environment: Workspace -> Specials -> Examples Library.

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC