Unless AHCMD runs really really fast, you will need to put it into it's own thread, or it will block your network code and GUI. Also you should be using
Wx::Socket for your sockets. But after all the responses I gave you in
Server with GUI, I'm giving up trying to correct your code. Please go to
jobs.perl.org to get someone to write your code for you.