Python: Server-Client connection - Error: Server crash
<ol>
<li>I open the server</li>
<li>I open the client</li>
<li>The client sends "connectrequest" to server</li>
<li>Server recvs "connectrequest"</li>
<li>Server sends "connected" to client</li>
<li>Client recvs "connected" from server</li>
<li>Client print "Connected"!</li>
<li>Server crashs and I cannot found why (Also I cant see the error).</li>
</ol>

<p>Server:</p>

<pre><code>from socket import *;

iSocket = socket( AF_INET, SOCK_DGRAM );
iSocket.bind( ( "", 4325 ) );

while True:

    recv_data, addr = iSocket.recvfrom( 2048 );

    if addr[ 0 ] == "127.0.0.1":

        #stuff

    elif recv_data == "on":
        print "New connection:", addr[ 0 ];

    elif recv_data == "connectrequest":
        iSocket.sendto( "connected", addr );
</code></pre>

<p>Client:</p>

<pre><code>import time;
import select;
from socket import *;

address = ( '192.168.0.101', 4325 );

iSocket = socket( AF_INET, SOCK_DGRAM );
iSocket.connect( address );

reconnect = 10;
last_reconnect = 0;
connected = False;

while connected == False:

    if last_reconnect &lt;= int( time.time( ) ) + reconnect:
        print "Connecting...";
        iSocket.sendto( "connectrequest", address );

    data_available = select.select( [ iSocket ], [ ], [ ], 11 )

    if data_available[ 0 ]:
        recv_data, addr = iSocket.recvfrom( 2048 );

        if recv_data == "connected":
            connected = True;
            print "Connected!";

iSocket.sendto( "on", address );

while True:

    recv_data, addr = iSocket.recvfrom( 2048 );
    print recv_data, addr;
</code></pre>
