tba.
The Client-class is an interface, which automatically connects to the server set in the config. The Client class should be used everywhere where ther is the need to connect to the data-base.
It is possible to access the database through the server by using predefined services.
Each request a client does to the server the request and its response is stored in a dict. this method will add an entry to this dictionary.
| Parameters: |
|
|---|---|
| Returns: | unpickled response |
| Return type: | variant object |
this method establishes a connection to the server. in case it wasn’t possible to connect to the server, the result will be 0
| Returns: | success-value 1 if the connection was successful 0 if not |
|---|---|
| Return type: | int |
gets the host from the config or takes the default host, which is the local
| Returns: | host |
|---|---|
| Return type: | string |
gets the port from the config or takes the default port, which is 50007
| Returns: | port |
|---|---|
| Return type: | int |
method will query the request history by one of the given args: id, request, response if id is given, the ids entry in the history is returned, if request is given, all history-entries with the given request are returned and if response is given, all history entries with the given response are returned
| Parameters: |
|
|---|---|
| Returns: | method will either return a list of dictionaries or a single dictionary. |
| Return type: | list or dictionary |
method will send a request to the server. argument-dictionary will be pickled and the server will send back a pickled object as well.
| Parameters: |
|
|---|---|
| Returns: | the return of this method will be the returnValue of the Service-request-function, which ran on the server. |
| Return type: | unpickledObject |
method is a wrapper around the sendRequest method, and takes a list of service-requests instead of just one. return Value is a list of all server-replies
| Parameters: | requests (list) – a list of tuples which hold two strings and one dictionary |
|---|---|
| Returns: | list of all server-responses |
| Return type: | list |
The server class provides the functions to start and stop a socket server, that waits for other programs to communicate with the main program. Inbetween calling the start and stop functions a socket will be opened. The port# which is opened is 17473 on your localhost(127.0.0.1) as standard
alias of SqLiteDataBase
gets the host from the config or takes the default host, which is the local
| Returns: | host |
|---|---|
| Return type: | string |
gets the port from the config or takes the default port, which is 17473
| Returns: | port |
|---|---|
| Return type: | int |
this will return a dictionary holding the complete history of all server-requests :returns: former requests :rtype: dictionary
method starts the database and stores the instance in the self.dB class-variable
starts a loop which listens to incoming connections and connects to the client. Incoming commands are BYTEARRAYs which will be decoded as a STRING within this function. It is possible to send multiple commands at once by separating each command with the ‘|’ character. After receiving the ‘closeSocket’ command this function will disconnect from the incoming client and will wait for the next client who connects.
the pipeLionServerException class will create an error-message for the pipeLionServer in case there was an error, due to a wrong request to the server