threaded client/server listening functions

this should prevent the GUI from being blocked