fix multi threading
make sockets non blocking