complete serversocket function. nearly OK !