title: Don't receive a response from sr1 function of scapy. How to specify the timeout parameter? [Python]
body: <p>I am trying to establish a 3-way handshake connection using Scapy with all the device on my network. However, there is a device that does not respond to a SYN packet and my program is stuck. I am using Wireshark for inspection of packets, and nothing comes back.
  Is there any way that can overcome this issue? similar to a timeout parameter of <code>sr()</code> function.</p>
  
  <p>I've create a syn packet like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>pkt = sr1(IP(dst=destinationIP)/TCP(dport=destinationPort, flags='S', seq=sequenceNum, ack =acknowledgeNum))
  </code></pre>
  
  <p>Then i am checking the responses with an if statement:</p>
  
  <pre class="lang-py prettyprint-override"><code>if pkt[TCP].flags == 18: #for SYNACK
      then do something
  else:
      close connection
  </code></pre>
  
  <p>For all the devices of the network, the program works fine. However, there is one device that does not respond, but I don't care about it. All I want is to be able to capture somehow that there is no response from <code>sr1</code> function and send a packet to the next device.
  <code>sr1()</code> function does not have a timeout parameter. What i tried to do was something like:</p>
  
  <pre class="lang-py prettyprint-override"><code>if pkt is None:
      continue
  </code></pre>
  
  <p>But it does not work as well.</p>