Add socket function of client