implemented server-socket function