Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 



Messenger.SendMessageTimeoutCallback

Messenger     See also    


Sends a message to the recipient, request reply and return immediately.

Declaration

[C++]
    void SendMessageTimeoutCallback(const char* Destination, IPCMessage* Message, DWORD Timeout, IPCNotifyProc CompletionProc, IPCNotifyProc TimeoutProc, IPCErrorProc ErrorProc, DWORD UserData, IPCMessageCredentials* Credentials);

[Pascal]
    procedure SendMessageTimeoutCallback(Destination: string; var Message: TIPCMessage; Timeout: DWORD; CompletionProc: TIPCNotifyProc; TimeoutProc: TIPCNotifyProc; ErrorProc: TIPCErrorProc; UserData: DWORD; Credentials: PIPCMessageCredentials);

[VB6]
    Sub IIPCXMessenger2.SendMessageTimeoutCallback(Destination As String, Message As IIPCXMessage, Timeout As Long, Credentials As IPCXMessageCredentials)

[ActiveX]
    HRESULT _stdcall IIPCXMessenger2.SendMessageTimeoutCallback([in] BSTR Destination, [in] IIPCXMessage Message, [in] unsigned long Timeout, [in] IIPCXMessageCredentials Credentials );
NotifyProc parameter is not available. Callback is implemented as OnCompletion event in IPCXMessenger object.
TimeoutProc parameter is not available. Callback is implemented as OnTimeout event in IPCXMessenger object.
ErrorProc parameter is not available. Callback is implemented as OnError event in IPCXMessenger object.

[C#]
    public void SendMessageTimeoutCallback(string Destination, IPCMessage Message, int Timeout, IPCNotifyProc CompletionProc, IPCNotifyProc TimeoutProc, IPCErrorProc ErrorProc, object UserData, IPCMessageCredentials Credentials);

[VB.NET]
    Public Sub SendMessageTimeoutCallback(ByVal Destination As String, ByVal Message As IPCMessage, ByVal Timeout As Integer, ByVal CompletionProc As IPCNotifyProc, ByVal TimeoutProc As IPCNotifyProc, ByVal ErrorProc As IPCErrorProc, ByVal UserData As Object, ByVal Credentials As IPCMessageCredentials)

[Java]
     public synchronized void sendMessageTimeoutCallback(String destination, IPCMessage message, Object timeout, IPCNotifyProc completionProc, IPCTimeoutProc timeoutProc, IPCErrorProc errorProc, long userData, IPCMessageCredentials credentials);

[Java ME]
    public synchronized void sendMessageTimeoutCallback(String destination, IPCMessage message, Object timeout, IPCNotifyProc completionProc, IPCTimeoutProc timeoutProc, IPCErrorProc errorProc, long userData, IPCMessageCredentials credentials);

[DLL]
    long __stdcall IPCMessengerSendMessageTimeoutCallback(HIPCMessenger h, const char* Destination, IPCMessage* Message, unsigned long Timeout, IPCNotifyProc CompletionProc, IPCNotifyProc TimeoutProc, IPCErrorProc ErrorProc, unsigned long UserData, IPCMessageCredentials* Credentials);

Parameters

  • Destination - The address of the message recipient. See more here
  • Message - The message to be sent. See more here
  • Timeout - Time (in milliseconds) after which the method marks the message as failed and returns. Setting this parameter to 0xFFFFFFFF ($FFFFFFFF) causes the method to wait infinitely for reply (in fact, waiting is stopped after time specified by MaxTimeout property elapses)
  • CompletionProc - The function that will be called when the reply is received.
  • TimeoutProc - Deletes expired messages from queue.
  • ErrorProc - The function that will be called when the message is returned as failed.
  • UserData - Application-defined parameter that will be passed as a first parameter of the NotifyProc function. This lets you set NotifyProc to a reference to class memeber, and pass an instance reference in UserData parameter.
  • Credentials - (optional) Credentials to be set for the message. Can be set to null (nil) if credentials system is not used. See more here
  • [DLL]h - handle to the Messenger object that was returned by Create method

Description

    Call this method to send the message to some other messenger and be notifed when the result arrives or the message is returned as failed. At the same time you can use this method when you want wait for reply from the recipient for specified time, optionally dispatching incoming messages. Destination specifies the address of the recipient. This method determines the right transport to use and passes the message to the transport. If the transport was not found or the request didn't reach the recipient for some reason, an exception is raised. [DLL] Error is determined by return value.
    Result of the message is passed together with message data to the callback function defined by NotifyProc. For information about error and timeout handling see Error and Timeout Handling topic.

    Note, that OnTimeout is not called exactly after the period specified in Timeout parameter. Once per certain time interval, specified in CleanupInterval, DispatchMessages method (you need to call it) scans all outgoing messages and searches for expired ones. If they are found, OnTimeout is called.