Add socket read functionality