Skip to content

Instantly share code, notes, and snippets.

@eranrund
Created August 10, 2012 12:20
Show Gist options
  • Select an option

  • Save eranrund/3313868 to your computer and use it in GitHub Desktop.

Select an option

Save eranrund/3313868 to your computer and use it in GitHub Desktop.

Revisions

  1. eranrund created this gist Aug 10, 2012.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import requests
    reqsess = requests.session()
    try:
    r = reqsess.get(r'http://www.mouser.com/Search/Refine.aspx?Keyword=test')
    d = r.text
    finally:
    reqsess.close()

    print 'done'
    import time
    time.sleep(10) # Have a look at netstat during this time and see a leftover socket in CLOSE_WAIT state