Skip to content

Commit 3f1f286

Browse files
committed
Added SO_LINGER to AdbClient socket (dtmilano#173)
- Idea proposed by @kysersozelee
1 parent 8966f17 commit 3f1f286

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/com/dtmilano/android/adb/adbclient.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ def connect(hostname, port, timeout=TIMEOUT):
204204
if DEBUG:
205205
print >> sys.stderr, "AdbClient.connect(%s, %s, %s)" % (hostname, port, timeout)
206206
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
207+
# SO_LINGER: Idea proposed by kysersozelee (#173)
208+
l_onoff = 1
209+
l_linger = 0
210+
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
211+
struct.pack('ii', l_onoff, l_linger))
207212
s.settimeout(timeout)
208213
try:
209214
s.connect((hostname, port))

src/com/dtmilano/android/viewclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
DEBUG_VIEW_FACTORY = DEBUG and False
6767
DEBUG_CHANGE_LANGUAGE = DEBUG and False
6868
DEBUG_UI_AUTOMATOR_HELPER = DEBUG and False
69-
DEBUG_NAV_BUTTONS = DEBUG or True
69+
DEBUG_NAV_BUTTONS = DEBUG and False
7070

7171
WARNINGS = False
7272

0 commit comments

Comments
 (0)