Discussion:
Using the synchronous APPC API can set timeout
(too old to reply)
zhangych
2008-11-17 14:15:54 UTC
Permalink
when i used the sync APPC API,can i use the signal alarm to set the
timeout,when timeout,then deallocate the session?

can i use the APPC API just like the socket fd using the function select to
set the timeout?
l***@attglobal.net
2008-11-18 01:40:58 UTC
Permalink
Post by zhangych
when i used the sync APPC API,can i use the signal alarm to set the
timeout,when timeout,then deallocate the session?
In the section in the "CS/AIX APPC Programmer's Guide"
titled 'APPC Entry Points' where it describes the
syncronous "APPC()" call it says that:
CS/AIX does not return control to the application
until the verb processing is complete.
so you should not expect to be able to do a deallocate
(on a different thread?) for a conversation which is
blocked on the synchronous entry point. In other words, you
don't 'have control' therefore a [MC_]DEALLOCATE() is not valid.

Also see further down in that same section where it says:
If the application performs multiple tasks (such as
communicating with more than one remote program at a
time, or performing other processing in addition to
APPC verbs), you may need to ensure that it does not
suspend while waiting for information. In this case,
the application should use the APPC_Async (asynchronous)
entry point, supplying a callback routine that CS/AIX
can use to return information when it is available
Your other posts imply 'communicating with more than one
remote program at a time', therefore you should be using
the asynchronous API.
Post by zhangych
can i use the APPC API just like the socket fd using the function select to
set the timeout?
I don't understand the question.
The socket select call has many parameters, one of which
is a timeout. The CS/AIX APPC API calls [APPC() and
APPC_Async() do not have a timeout parameter.
Therefore you cannot use APPC API 'just like' a socket select().

Paul Landay

Loading...