I'm not sure about it, but I think when doing socc.recv() the code will wait untill it gets something from the socket. thats why it won't move when it is not getting any data, and it would stay stuck in the recv (inside of the while loop).
Are you coding both server and client? If you do - before you send the data you can add the size of it (like 5 first bytes that the data size will be sent at). Than - do a recv for the first 5 bytes, get the data size, and do a recv for the data using this size.