-//send out data
-tinc_send_packet(remotenode,mydata,sizeof(mydata));
-sleep(10); //give time to this thread to finish before we exit
-}
-free(remotenode);
-return 0;
+ //sample data to send out
+ char mydata[200];
+ memset(mydata,0,200);
+ strcpy(mydata,"Hello World!");
+
+ //send out data
+ meshlink_send(myhandle,remotenode,mydata,sizeof(mydata));
+ }
+
+ meshlink_stop(myhandle);
+ meshlink_close(myhandle);
+
+ return 0;