Please enable JavaScript to view this site.

ESL Documentation

Field Types

Called from a user-written DLL subroutine to send a buffer of data to a partner. The sender can request that data be sent immediately, can request a confirmation, and can indicate that a reply from the partner is expected before more data is sent. The buffer must have previously been prepared by the user-written routine.

Note:        An APPC_ConfirmRequest event is signalled to your ESL program when the partner program requests confirmation. Your ESL program must respond by either calling APPCSendConfirmed or APPCSendError. If your program calls APPCSendConfirmed, it generates a confirm notification to the partner program. When the partner is an ESL program, this triggers its response to stimulus ... APPC_Confirmed response statement. If your program calls APPCSendError, it generates an error notification to the partner program. When the partner is an ESL program, this triggers response to stimulus ... APPC_ReceiveError.

C Language Declaration:

The declarations for this subroutine and for the integer constants that can be used with it are found in the ESL APPC C language include file (ESLAPPC.H).

APPCSendDLLData is declared in the include file, ESLAPPC.H, according to the following syntax:

USHORT EXPENTRY APPCSendDLLData(ULONG CONVERSATION_ID,

                                PBYTE BUFFER_POINTER,        

                                USHORT BUFFER_LENGTH,

                                USHORT SEND_IND,

                                USHORT MORE_TO_SEND);         

Arguments:

CONVERSATION_ID is an unsigned long value containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.

BUFFER_POINTER is a pointer to a buffer of data to send to the partner.

BUFFER_LENGTH is an unsigned short value containing the length of the data buffer.

SEND_IND is an unsigned short value used to specify control over when data is actually sent to the partner. Valid constants are:

APPC_None

(Default) Data is accumulated in a buffer to be sent when the buffer is full, or when another request causes the data to be sent.

APPC_Flush

The data is sent immediately.

APPC_Confirm

The data is sent immediately and a confirm notification is requested.

APPC_SyncLevel

The data is sent based upon the synchronization level of the conversation, established when it was started. If the synchronization level was specified as APPC_None, the data is sent immediately. If the synchronization level was specified as APPC_Confirm, the data is sent immediately and a confirm notification is requested.

Note: A response to stimulus ... APPC_ConfirmRequest response definition MUST be included in your ESL program if confirmation will be requested by its partner. Otherwise the conversation will not proceed! The response to stimulus ... APPC_Confirmed response definition is activated when the partner program sends your program a confirmation in response to your confirmation request.

       MORE_TO_SEND is an unsigned short value that indicates whether your program has more data to send following the string being sent with this call. Valid constants are:

APPC_MoreData

(Default) Indicates that this application has more data to send before it expects a response.

APPC_ReadyToReceive

Indicates that the application expects to receive data from its partner before it has more data to send.

Errors:

APPC_NORMAL_COMPLETION

Normal completion.

APPC_ERR_OUT_OF_MEMORY

Out of memory.

APPC_ERR_INV_CONV_ID

Invalid argument: CONVERSATION_ID

APPC_ERR_INV_SEND_IND

Invalid argument: SEND_IND

APPC_ERR_INV_MORE_TO_SEND

Invalid argument: MORE_TO_SEND

APPC_ERR_INV_BUFFER_POINTER

Invalid argument: BUFFER_POINTER

APPC_ERR_LGTH_EXCDS_PRF_BUFSIZE

Invalid argument: BUFFER_LENGTH String length exceeds buffer size specified in profile.

APPC_ERR_UNEXPECTED_ERROR

Unexpected error encountered.

APPC_ERR_UNEXPECTED_DOS_ERROR

Unexpected operating system error encountered.

Examples:

In the ESL program:

 

# Response to data from partner
 

response to stimulus APPC_EVENT APPC_Data ConvID
   . . .
   call MyAppSendData(ConvID,    # Handle from Start/AcceptStart

                      Int1,      # Fills BufInt1

                      String1,   # Fills BufStr1

                      String2,   # Fills BufStr2

                      String3)   # Fills BufStr3 

 

In the user-written DLL routine:

 

/* MyAppSendData, a routine written in C */
 

#include <eslappc.h> /* Defines to call functions */
 

typedef struct { /* Format of data to send/receive */

   unsigned long BufInt1;
   char BufStr1[80];
   char BufStr2[16];
   char BufStr3[40];

} INPUTAREA;
INPUTAREA *MyBuf;
unsigned long ConvID;
unsigned short Length;
 

APPCSendDLLData(ConvID,                /* Handle from Start/AcceptStart */
                MyBuf,                 /* Buffer containing data */
                Length,                /* Length of data in buffer */
                APPC_Confirm,          /* Confirm receipt */
                APPC_ReadyToReceive ); /* Send expects reply */