Getting funky with Pi
Looks good as a proof of concept. I recommend to modularize python code, that is


Make socket interface into a function
Make GPIO interface into a function
Have a

if __name__ == '__main__'


clause to call them (directly or via a main) function.


I would also handle failures to connect (retry maybe?); a total fun is to implement service discovery via pybonjour or zeroconf.