Previous Topic: Message DescriptionNext Topic: Type Definitions


External Agent Socket API Header

All External Agent Socket API messages contain a two part header plus a variable length payload, followed by footer. The overall length of the message must be an integer multiple of four bytes. Padding bytes (set to zero) may be required after each entry in the Payload field to achieve this.

The primary header contains the following fields:

Bytes

Field Name

Type

Description

Mandatory?

0 – 3

Schema ID

UINT4
Big-endian.

Identifies the schema for the message. This value must be set to WGNSCH_SKT_SERVER_VER1 as defined by the WGN_MSGSCHEMATYPE enumeration.

Yes

4 – 7

Message Size

UINT4
Big-endian.

Overall size of message including headers. This limits maximum file size to approx. 4 GB.

Yes

The format of the secondary header is as follows:

Bytes

Field Name

Type

Description

Mandatory?

0 – 3

RoutingID

UINT4
Big-endian

Can be used for load balancing with the Distributor. If used, it must be present in the Distributor Routing ID table.

No

4 – 7

Message ID

UINT4
Big-endian

Unique message identifier.

Yes

8 – 11

MessageType

UINT4
Big-endian

Identifies the message type - one of the WGN_MESSAGETYPE enumerations in Appendix B.

Yes

12

Priority

BYTE

Priority of the message 0 (low) 256 (high) (reserved for future use) – Must be zero. Zero means use the default priority.

Yes

13

Flags1

BYTE

FLAGS1_ExpectReply (0x01)

Set by Socket Agent when a completion message is required.

-

14

Flags2

BYTE

FLAGS2_ReturnToSenderPort (0x01)

FLAGS2_EnablePartialEvent (0x02)

FLAGS2_MultipartMsgFirst (0x04)

FLAGS2_MultipartMsgIntermediate(0x08)

FLAGS2_MultipartMsgLast(0x0C)

-

15

Flags3

BYTE

Reserved – Must be set to zero

-

16-19

Process Result

HRESULT

Must be set to zero for messages passed to the External Agent API.

On return, this field contains the HRESULT of processing the message.

No

20 – 23

Routing Context

UINT4
Big-endian.

Internal use – The Distributor sets this to the IP address of the sender. The Distributor passes back the IP Address of the Socket Agent on the Response.

On an External Agent request message, this must be set to zero.

When sending an External Agent completion message, the application sets these to the Routing Context from the original message response.

-

24 – 27

Reserved2

UINT4
Big-endian.

Internal use – The Distributor sets this to the IP port of the sender.

-

28 – 31

Reserved 3

UINT4
Big-endian.

Reserved for internal use. Must be set to zero.

-