add send and recv function geting and writing info to socket