Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Asynchronous execution mode

&pagelevel(3)&pagelevel

Many of the transport interface functions can block a process if they wait for specific events or block the process data flow. However, there are situations where the user will want to prevent this blocking. For example, time-critical applications should never be blocked. In another case, the process wants to continue working while waiting for a transport interface event.

Each function which could block the process can therefore be executed in a special nonblocking (asynchronous) mode. The t_listen() call normally blocks the calling process (server) until the connection is confirmed. However, the server could also use the nonblocking t_listen() call to periodically check whether the connection has been set up. The asynchronous mode is enabled with the O_NONBLOCK parameter for the file ID concerned. This can be done with t_open() when the transport endpoint is opened or with an fcntl() call before a prospective blocking transport interface function is called. fcntl() can be used at any time to enable/disable the asynchronous mode.
All program examples in this chapter use the default synchronous mode.