INNER CODE UNIT · Python
_connect_sock
codematrixer/hmdriver2 · hmdriver2/_client.py:39
def _connect_sock(self):
"""Create socket and connect to the uiTEST server."""
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(SOCKET_TIMEOUT)
self.sock.connect((("127.0.0.1", self.local_port)))
def _send_msg(self, msg: typing.Dict):
"""Send an message to the server.
Example:
{
"module": "com.ohos.devicetest.hypiumApiHelper",
"method": "callHypiumApi",
"params": {
"api": "Driver.create",
"this": null,
"args": [],
"message_type": "hypium"
},