Server process closes the connection as soon as one client is done executing
<p>I am implementing basic socket program , but in this case i want the server process to keep on running . But the problem is as soon as client is executed , the server also closes the connection . </p>

<p>here`s the server code :</p>

<pre><code># Echo server program
import socket

HOST = ''                 # Symbolic name meaning all available interfaces
PORT = 50007              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
 data = conn.recv(1024)
 print data
 if not data: break
 data1 = " Hello client 1 "
 conn.send(data1)
#conn.close() 
</code></pre>

<p>The following is the client code </p>

<pre><code># Echo client program
import socket

HOST = 'localhost'    # The remote host
PORT = 50007              # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('Hello, world')
data = s.recv(1024)
s.close()
print 'Received', repr(data)
</code></pre>

<p>I want the server code to keep on running , so that even if i run client code again , the server should process it .</p>
