Jump to content


Check out our Community Blogs

CallBackGuy

Member Since 06 Mar 2009
Offline Last Active Aug 30 2009 05:48 AM
-----

#494939 Sockets

Posted by CallBackGuy on 01 August 2009 - 10:32 PM


import socket

mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

mySocket.connect(("forum.codecall.net", 80))

mySocket.send("GET / HTTP/1.1\n")

mySocket.send("Host: forum.codecall.net\n\n")

text = ''



while 1:

    data = mySocket.recv(1024)

    text += data

    if not data: break

    

mySocket.close()



print text


  • 1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download