RESOLVED INVALID164338
Add TCP server to webkitpy for on device testing
https://bugs.webkit.org/show_bug.cgi?id=164338
Summary Add TCP server to webkitpy for on device testing
Jonathan Bedard
Reported 2016-11-02 13:51:05 PDT
In order to test on device, a TCP connection will be opened between device and host. This adds the TCP server which will run on the host into webkitpy.
Attachments
Patch (31.59 KB, patch)
2016-11-02 13:53 PDT, Jonathan Bedard
no flags
Patch (31.48 KB, patch)
2016-11-04 12:04 PDT, Jonathan Bedard
no flags
Patch (27.78 KB, patch)
2016-11-16 08:55 PST, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2016-11-02 13:53:06 PDT
Jonathan Bedard
Comment 2 2016-11-02 15:33:51 PDT
https://bugs.webkit.org/show_bug.cgi?id=164344 contains the client-side of this server. Note that this patch does not use the TCP server, it simply implements it.
Dean Johnson
Comment 3 2016-11-04 11:13:43 PDT
Comment on attachment 293692 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=293692&action=review Gave some feedback where possible - I'm probably not the best candidate for reviewing such low level interactions. Great work on this! > Tools/Scripts/webkitpy/common/relayserver.py:58 > + bound = False The loop here could be rewritten for conciseness as follows: upper_bound = PORT_RANGE[1] - PORT_RANGE[0] for port in range(self._port, self._port + upper_bound): try: self._socket.bind((self._host, port)) self._port = port break except socket.error as msg: pass else: # This condition gets hit if you never break from a for loop raise Exception('Ran out of ports to try to bind to for the TCP server.) I would also recommend 'return'ing after the binding the port in `if port`. Then you can remove the else statement too. > Tools/Scripts/webkitpy/common/relayserver.py:177 > + return str() Generally speaking you should return '' over str().
Jonathan Bedard
Comment 4 2016-11-04 12:04:31 PDT
Radar WebKit Bug Importer
Comment 5 2016-11-10 10:07:43 PST
Jonathan Bedard
Comment 6 2016-11-16 08:55:46 PST
Jonathan Bedard
Comment 7 2016-12-15 13:43:06 PST
Using a different approach.
Note You need to log in before you can comment on or make changes to this bug.