Similar code (to 1056724) is getting executed in Server::initServer() and Client::initClient() routines respectively.
But the problem is if I shift the 'MainLoop' statement in the end of the script after the initiation of server and client , then the gui is not appearing although the server is getting started.
Without a listing of Server.pm and Client.pm my only guess is that $server->initServer();
is not returning. Probably the former as you don't mention the client getting started.