socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host (python2.7)
<p>I have a problem with my socket , it is well functioning but when i close the client / close the client window the server lost the connection <em>( the server needs to stay open and wait for other connection)</em></p>

<pre><code>while True:
    rlist, wlist, xlist = select.select([server_socket]+open_client_sockets, open_client_sockets, [])
    for current_socket in rlist:
        if current_socket is server_socket:
            (new_socket, address) = server_socket.accept()
            open_client_sockets.append(new_socket)
            print 'new member : ' + str(address)
        else:
            data = current_socket.recv(1024)
            print data
            if data == "":
                open_client_sockets.remove(current_socket)
                print 'Connection with client closed.'

            else:
                send_messages(data)
</code></pre>

<p>The problem is in this part - </p>

<pre><code>if data == "":
                open_client_sockets.remove(current_socket)
                print 'Connection with client closed.
</code></pre>

<p>This is the error - </p>

<pre><code>data = current_socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
</code></pre>

<p>I didn't get this error in my previous socket  </p>