Function silc_client_command_pending
SYNOPSIS
void silc_client_command_pending(SilcClientConnection conn,
SilcCommand reply_cmd,
SilcUInt16 ident,
SilcCommandCb callback,
void *context);
DESCRIPTION
This function can be used to add pending command callback to be
called when an command reply is received to an earlier sent command.
The `reply_cmd' is the command that must be received in order for
the pending command callback indicated by `callback' to be called.
The `callback' will deliver the `context' and
SilcClientCommandReplyContext which includes the internals of the
command reply.
The `ident' is a command identifier which was set for the earlier
sent command. The command reply will include the same identifier
and pending command callback will be called when the reply is
received with the same command identifier. It is possible to
add multiple pending command callbacks for same command and for
same identifier.
Application may use this function to add its own command reply
handlers if it wishes not to use the standard `command_reply'
client operation. However, note that the pending command callback
does not deliver parsed command reply, but application must parse
it itself.
Note also that the application is notified about the received command
reply through the `command_reply' client operation before calling
the `callback` pending command callback. That is the normal
command reply handling, and is called regardless whether pending
command callbacks are used or not.
Commands that application calls with silc_client_command_call
will use a command identifier from conn->cmd_ident variable. After
calling the silc_client_command_call, the conn->cmd_ident includes
the command identifier that was used for the command sending.
EXAMPLE
silc_client_command_call(client, conn, "PING silc.silcnet.org");
silc_client_command_pending(conn, SILC_COMMAND_PING, conn->cmd_ident,
my_ping_handler, my_ping_context);
|