title: socket.error: [Errno 10054]
body: <pre><code>import socket, sys
  
  if len(sys.argv) !=3 :
  print "Usage: ./supabot.py &lt;host&gt; &lt;port&gt;"
  sys.exit(1)
  
  irc = sys.argv[1]
  port = int(sys.argv[2])
  sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  sck.connect((irc, port))
  sck.send('NICK supaBOT\r\n')
  sck.send('USER supaBOT supaBOT supaBOT :supaBOT Script\r\n')
  sck.send('JOIN #darkunderground' + '\r\n')
  data = ''
  while True:
        data = sck.recv(1024)
        if data.find('PING') != -1:
           sck.send('PONG ' + data.split() [1] + '\r\n')
           print data
        elif data.find('!info') != -1:
            sck.send('PRIVMSG #darkunderground supaBOT v1.0 by sourD' + '\r\n')
  
  
  print sck.recv(1024)
  </code></pre>
  
  <p>when I run this code I get this error..</p>
  
  <blockquote>
    <p>socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host</p>
  </blockquote>
  
  <p>it says that the error is in line 16, in  data = sck.recv(1024)</p>