Two things i noticed but have nothing to do with your problem:
1) Don't use port 80 for your server. Port 80 reserved for HTTP! Use a port greater than 1023 (I always use 2300).
2) Don't do everything in one step if you write a program. Do it step by step!
For example: In the first step you start to write the initialisation of ANet and then you TEST IT! In the next step you extend your script with the part that tries to start a server. If this works add the client initialisation. After that you try to connect them. And so on...
If you do too much steps in one it will be very hard for you to detect occuring problems.
I looked over your code, but I couldn't see anything that shouldn't work. If the ANet Demo message is displayed, ANet was loaded correctly and will work on your system.
There are three methodes you can use to solve your problem:
1) You could use the debugger to find out where the script freezes.
2) You try to comment everything out that is not related to your problem (step by step). If the problem suddenly doesn't occure anymore then the last thing you commented out causes your bug.
3) OR and that's what I would advice you to do, start to write this script again and do it step by step. This way you will have a much easier life! If you add a next step and a problem occures, you always know that you did something wrong in the last step and it should be easy for you to find out what causes the problem. Otherwise, a big project will be impossible to realise.
I hope I could help you
