Changes

Jump to navigation Jump to search
166 bytes added ,  14:28, 26 May 2013
In the following example, a client registers a new session and executes the [[Commands#INFO|INFO]] database command. Next, it creates a new query instance for the XQuery expression {{Code|1, 2+'3'}}. The query is then evaluated, and the server returns the result of the first subexpression {{Code|1}} and an error for the second sub expression. Finally, the query instance and client session are closed.
# * '''Client ''' connects to the database server socket# * '''Server ''' sends timestamp "1369578179679": {{Code|31 33 36 39 35 37 38 31 37 39 36 37 39 00}}# * '''Client ''' sends user name "jack": {{Code|6A 61 63 6B 00}}# * '''Client ''' additionally sends hashed password/timestamp combination<br/>: md5(md5("topsecret") + "1369578179679") = "66442c0e3b5af8b9324f7e31b7f5cca8": {{Code|36 36 34 ... 00}}# * '''Server ''' replies with success code: {{Code|00}}# * '''Client ''' sends the "INFO" command: {{Code|49 4E 46 4F 00}}# * '''Server ''' responds with the result "General Information...": {{Code|47 65 6e 65 ... 00}}# * '''Server ''' additionally sends an (empty) info string: {{Code|00}}# * '''Client ''' creates a new query instance for the XQuery "1, 2+'3'": {{Code|00 31 2C 20 32 2B 27 33 27 00}}# * '''Server ''' returns query id string "1" and a success code: {{Code|31 00 00}}# * '''Client ''' requests the query results via the RESULTS protocol command "\4" and the query id "1": {{Code|04 31 00}}# * '''Server ''' returns the first result ("1", type xs:integer): {{Code|52 31 00}}# Instead of a second result, * '''Server''' returns a single "\0" byte is returnedinstead of a new result, which indicates that no more results can be expected: {{Code|00}}# Next, server * '''Server''' next returns the error code "\1" and the error message ("Stopped at..."): {{Code|01 53 74 6f ... 00}}# * '''Client ''' closes the query instance: {{Code|02 31 00}}# * '''Server ''' sends a response (which is equal to an empty info string) and success code: {{Code|00 00}}# * '''Client ''' closes the socket connection
==Existing Clients==
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu