[Debugger] Implementation of transport over serial connection (#2800)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2019-03-26 09:39:51 +01:00
committed by GitHub
parent 0981985134
commit 3d656cdf57
14 changed files with 577 additions and 51 deletions
+6 -3
View File
@@ -17,17 +17,20 @@
import socket
import select
# pylint: disable=too-many-arguments,superfluous-parens
class Socket(object):
""" Create a new socket using the given address family, socket type and protocol number. """
def __init__(self, socket_family=socket.AF_INET, socket_type=socket.SOCK_STREAM, proto=0, fileno=None):
def __init__(self, address, socket_family=socket.AF_INET, socket_type=socket.SOCK_STREAM, proto=0, fileno=None):
self.address = address
self.socket = socket.socket(socket_family, socket_type, proto, fileno)
def connect(self, address):
def connect(self):
"""
Connect to a remote socket at address (host, port).
The format of address depends on the address family.
"""
self.socket.connect(address)
print("Connecting to: %s:%s" % (self.address[0], self.address[1]))
self.socket.connect(self.address)
def close(self):
"""" Mark the socket closed. """