#include <CodeClient.h>


Public Member Functions | |
| bool | Start (const char *code, const int nOnce1=0, const int nOnce2=0) |
| bool | Stop (bool hardware=false) |
| bool | GetCompleted (void) |
| CodeServer::Reply | GetReply (void) |
| int | GetUserSuppliedReply (void) |
| void | GetNOnces (int &nOnce1, int &nOnce2) |
| When there is a successful reply two random integers are generated by the CodeServer. | |
| void | SetEncryptionKey (const void *data, const int length) |
| void | SetServer (const XPAddress &address) |
| bool Start | ( | const char * | code, | |
| const int | nOnce1 = 0, |
|||
| const int | nOnce2 = 0 | |||
| ) |
Starts a code query. This query is asynchronous and can be stopped by using Stop(). If a code is requested for the same key within the CodeServer timeout period without supplying valid nonce values the key query will result in kReply_KeyInUse. If these values are used for future CodeClient::Start() calls with the same code value then the result will be a successful key query.
| code | The code to query with the server. This buffer must be a null terminated string. The buffer contents is copied by a pending query so it can be deallocated after using this call. | |
| nOnce1 | The first nonce. | |
| nOnce2 | The second nonce. |
| bool Stop | ( | bool | hardware = false |
) |
Stops the current code query thread.
| hardware | If true this stops the network hardware. The default is false. |
| bool GetCompleted | ( | void | ) |
Tests the completion state of the last query. When the query completes the result can be retrieved by using GetReply()
| CodeServer::Reply GetReply | ( | void | ) |
Returns the last reply from a completed query.
| int GetUserSuppliedReply | ( | void | ) |
Returns the last user supplied reply value from a completed query. See CodeServer::AddCode() for more details about a user supplied reply.
| void SetEncryptionKey | ( | const void * | data, | |
| const int | length | |||
| ) |
Sets the encryption key to be used by all queries for this client. The same key must be used with any RNLobby::CodeServer responding to queries from this client. The default encryption key is the same for RNLobby::CodeServer and RNLobby::CodeClient.
| data | the data to use as a seed for the key. This can be NULL to use the default key. | |
| length | the length of the data to use for creating the key |
| void SetServer | ( | const XPAddress & | address | ) |
Sets the address and port of the server. The default for the instance of the class is localhost and port CodeServer::kDefaultPort
| address | The new address and port number to use for the server |
1.5.3