Handle multiple data packets being returned in the same socket read call

Signed-off-by: Rhishikesh Joshi <rhishikeshj@gmail.com>