Please enable JavaScript to view this site.

Function for opening a client-type UDP communication.

The client sends messages to a specified destination station and eventually reads the response from the same station.

Syntax

i32 udp_open_client (u32 nPort, u32 nAddr)

nPort

Server port number (remote) to which the client will send its messages

nAddr

IP address (remote) to which the client will send its messages

Result

Returns:

Value

Meaning

0-:-99

Operation performed successfully. The communication ID is returned

-1

Illegal nPort

-2

nAddr illegal.

Must be different from 0

-3

All task connection table entries are already busy, 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 connect() failed: returns the code provided by connect(), 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 management functions

For a concrete example see in the 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