def open(self):
self.device = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<EOL>self.device.settimeout(self.timeout)<EOL>self.device.connect((self.host, self.port))<EOL>if self.device is None:<EOL><INDENT>print("<STR_LIT>".format(self.host))<EOL><DEDENT>
Open TCP socket with ``socket``-library and set it as escpos device