[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:
@@ -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. """
|
||||
|
||||
Reference in New Issue
Block a user