hi all i was recently building on a simple socket program i had written in python basically like a little chat client but i added a server_socket.close command to kill the server on disconnect and now im getting all sorts of indentation errors
Code:
#! /usr/bin/python
2 import socket
3 server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
4 server_socket.bind(("localhost", 5000))
5 server_socket.listen(5)
6
7 print "TCPServer Waiting for client on port 5000"
8
9 while 1:
10 client_socket, address = server_socket.accept()
11 print "I got a connection from ", address
12 while 1:
13 data = raw_input ( "SEND( TYPE q or Q to Quit):" )
14 if (data == 'Q' or data == 'q'):
15 client_socket.send (data)
16 client_socket.close()
17 server_socket.close()
18 break
19 else:
20 client_socket.send(data)
21 data = client_socket.recv(512)
22 if ( data == 'q' or data == 'Q'):
23 client_socket.close()
24 server_socket.close()
25 break
26 else:
27 print "RECIEVED:" , data
28
thats the code i have first error i get is line 18
File "./server.py", line 18
break
^
IndentationError: unindent does not match any outer indentation level