Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Set TCP No Delay (TCP_NODELAY)
Browse files Browse the repository at this point in the history
Suggestion from BillSobel in
#2 (comment)
  • Loading branch information
clach04 committed Apr 22, 2018
1 parent 490374d commit 01c123f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pytuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def _send_receive(self, payload):
payload(bytes): Data to send.
"""
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
s.settimeout(self.connection_timeout)
s.connect((self.address, self.port))
s.send(payload)
Expand Down

0 comments on commit 01c123f

Please sign in to comment.