server¶
Server to be running on network machine.
Must be running for client to be able to connect. Obviously, alongside this server, MATLAB should also be running.
-
class
mr_utils.matlab.server.
MATLAB
[source]¶ Object on server allowing server to communicate with MATLAB instance.
-
done_token
¶ Sequence of symbols to let us know MATLAB is done communicating.
Type: contract.done_token
-
process
¶ Process that runs MATLAB and stays open.
Type: subprocess
-
catch_output
(log_func=None)[source]¶ Grab the output of MATLAB on the server.
Parameters: log_func (callable, optional) – Function to use to log output of MATLAB console.
-
get
(varnames)[source]¶ Get variables from MATLAB workspace into python as numpy arrays.
Parameters: varnames (list) – List of names of variables in MATLAB workspace to get. Returns: tmp_filename – Name of temporary file where MATLAB workspace contents are stored. Return type: str Raises: ValueError
– When varnames is not a list type object.Notes
Notice that varnames should be a list of strings.
-
-
class
mr_utils.matlab.server.
MyTCPHandler
(request, client_address, server)[source]¶ Create the server, binding to localhost on port.
-
what
¶ The action we wish to perform.
Type: {contract.RUN, contract.GET, contract.PUT}
-
cmd
¶ The command to be run in the MATLAB console.
Type: str
-
rfile
¶ Stream from TCP socket that we are reading from.
Type: stream
-