get socket function implemented