Skip to content

Commit

Permalink
Added SO_LINGER to AdbClient socket (#173)
Browse files Browse the repository at this point in the history
 - Idea proposed by @kysersozelee
  • Loading branch information
dtmilano committed Feb 11, 2016
1 parent 8966f17 commit 3f1f286
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/com/dtmilano/android/adb/adbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ def connect(hostname, port, timeout=TIMEOUT):
if DEBUG:
print >> sys.stderr, "AdbClient.connect(%s, %s, %s)" % (hostname, port, timeout)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# SO_LINGER: Idea proposed by kysersozelee (#173)
l_onoff = 1
l_linger = 0
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack('ii', l_onoff, l_linger))
s.settimeout(timeout)
try:
s.connect((hostname, port))
Expand Down
2 changes: 1 addition & 1 deletion src/com/dtmilano/android/viewclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
DEBUG_VIEW_FACTORY = DEBUG and False
DEBUG_CHANGE_LANGUAGE = DEBUG and False
DEBUG_UI_AUTOMATOR_HELPER = DEBUG and False
DEBUG_NAV_BUTTONS = DEBUG or True
DEBUG_NAV_BUTTONS = DEBUG and False

WARNINGS = False

Expand Down

0 comments on commit 3f1f286

Please sign in to comment.