added parallel actions

changed socket server to threads
added client check with random number