Handler function
Type 3
The handler function of Type 3 will be called when a client request something that starts with the protocols that the function AddinData sended.
The handler function doesn't have to be exported, the AddinData function sends the address of this function. It is able to change all the data in the pointers.
Syntax
Handler(
SOCKET Client,
LPTSTR SendedData,
DWORD SendedDataSize);
Parameters
Client
A pointer to a descriptor identifying a connected socket that was made connecting to a socket.
SendedData
A pointer to a pointer to a NULL terminated string the contains all the data that the client has send.
The was located with function LocalAlloc, please when it need more size release the data with function LocalFree and change the parameter with a pointer created with LocalAlloc.
SendedDataSize
A pointer to the size of the SendedData string.
Return Value
If the function returns 0 the server will close the connection with the client by calling shutdown and wait until recv returns 0.
Return value -1 and the server will just continue.
Return any other value and the server will just continue, only call type 1 add-in with protocol * and call the SendHandler when it will send data with this return value as parameter.