added further imporvement on server side to read header and data. 0 length header need to be considered
as 'close connection'