Python Server with multiple Sents
<p>How do i make a Server that sents multiple data (1.st file name, 2nd binary file data)?</p>

<p>I only can send 1 data because the client stops the .recv() function only if connection is closed.</p>

<p>Sorry i have no idea, i thougt the recieve function does automaticly know when the end is send.</p>

<pre><code>"""
    SOCKET VERBINDUNG AUFBAUEN
"""
serverHost = 'localhost'
serverPort = 2000
server = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
server.bind((serverHost, serverPort))
server.listen(1)

# Liste der Clients
clients = []
sock = []
wlist = []

try:
    while True:
        lesen, schreiben, oob = select.select([server] + clients, wlist, [])

        for sock2 in lesen:

            #if sock2 in server:
                client, adress = server.accept()
                clients.append(client)
                wlist.append(client)
                print "Client verbunden: %s" % adress[0]
                break;


            #else:
                #sock2.close()
                #print 'hier'
                #clients.remove(sock)

        for sock2 in schreiben:
            print 'he'
            if sock2 in clients:
                print "Uebertragung Dateiname beginnt..."

                client.send(fileNameList[0])


                clients.remove(client)
                wlist.remove(client)
                sock2.close()
                print "...Uebertragung abgeschlossen!"
                #sock2.close()
                #clients.remove(client)
</code></pre>
