Hi,
A similar question was posted on Discussion Forums soem time back. Please see the link below.
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000C7B00000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
You would find the last post in the above thread quite useful where it has a link to OpenG code. I am also copying that link for your reference.
http://www.openg.org/tiki/tiki-index.php?page=OpenG+Internet+Connectivity+Tools
Please feel free to respond to this post with any questions/comments you may have.
Regards,
Ankita A.
National Instruments