when i have done simple client server programme of data excahnge i used to receive only the data part(payload)

but how to get the entire packet assuch...do u have a sample snippet