There are many threads relating to this topic.

See here for comprehensive code on how to both send and recieve.

Eamonn.