ImpAccept - Explicitly accept (or reject) a connection request from another task.

Function

Explicitly accept (or reject) a connection request from another task.

Description

This routine should be called when a task receives a system message requesting a connection. If called with the Accept parameter set true, for a two-way connection it completes the connection, setting up its own connection with the requesting task and notifying the requesting task that this has been done. If the connection is only a one-way connection that has to be confirmed, no new connection is set up, but a connection accepted message is sent to the requesting task.

Language

C.

Call

ImpAccept (ProcID,MsgInfo,ConnectInfo,Accept,Connection,Status)

Parameters

>ProcIDIMP_IDThe calling task's IMP process ID, as returned by its initial call to ImpRegister.
>MsgInfoIMP_MsgInfo *The structure describing the message requesting the connection, as returned by ImpRead() or ImpReadPtr().
>ConnectInfoIMP_ConnectInfo *Used to pass the messge sizes that this task anticipates needing.
>AcceptintSet true (non-zero) if the connection is to be accepted, false (zero) if it is to be rejected.
<Connectionint *If a connection is made as a result of this call, this receives the connection number.
!StatusIMP_Status *Inherited status value. If a non-zero value is passed, this task returns immediately. Otherwise if an error occurs Status will be set to an IMP__xx error code.

Fields in ConnectInfo to be set prior to the call

MessageBytes, MaxMessages, TaskID.

Fields in ConnectInfo set as a result of this call

None.

Note

The MessageBytes and MaxMessages fields of ConnectInfo are only used if a 2-way connection is being accepted. In this case, MessageBytes gives the maximum message size that this task anticipates sending and MaxMessages gives the maximum number of messages of size MessageBytes that may be queued in the reply connection. If either of MaxMessages or MessageBytes are set zero, then the values originally suggested by the requesting task are used. The TaskID field must be set to the task identifier of the task requesting the connection; normally this will be that returned by ImpSystemMessage(). This routine can tell from the information in MsgInfo whether or not a two-way connection was requested.

External variables used

None.

Prior requirements

This routine should only be called after a call to ImpSystemMessage() has returned a code of IMP_SYS_CONNECT, indicating that a connection request was received.

Version date

27th July 1995.

Support

K. Shortridge, AAO.

Internal declaration

     void ImpAccept (
        IMP_ID ProcID,
        IMP_MsgInfo *MsgInfo,
        IMP_ConnectInfo *ConnectInfo,
        int Accept,
        int *Connection,
        IMP_Status *Status)

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tjf@aaoepp.aao.gov.au