0

I used a library called TinyXML2 for creating my XML file that has all the data in it. Now I want to transfer my XML file over UDP. I know that I have to transfer node by node in my XML file. But I don't know the exact procedure. Can anyone tell me how to do it ?

<xml>
   <child>
       <firstchild id = "1">
            <age>10</age>
       </firstchild>
       <firstchild id = "2">
            <age>20</age>
       </firstchild>   
   </child>
</xml>
Venkatavaradhan
  • 139
  • 4
  • 13
  • You need to create protocol, but better use TCP – Slava May 24 '18 at 20:24
  • Any reason you have chosen UDP? TCP is usually a better fit for file transfer. How much do you know about socket programming and what is your target platform? – user4581301 May 24 '18 at 20:24
  • I know how to write simple socket program. But I understand that the data I'm transmitting don't have to be acknowledged by the receiver which makes it faster to communicate my data. – Venkatavaradhan May 24 '18 at 20:29
  • 2
    If you know socket programming, then you should be able to create two programs: a sender and a listener. So, what exactly is your problem? – Adrian W May 24 '18 at 20:32
  • If you want help with your socket code you need to post it. The `xml` you posted is not that meaningful to the question or solving whatever problem you have. If you don't know sockets there should be 1000s of examples of a `c++` network chat program if you google. – drescherjm May 24 '18 at 21:13

1 Answers1

0

https://beej.us/guide/bgnet/html/single/bgnet.html The holy grail to working with network sockets. Like others have said, you should use TCP. UDP is something you would use for video chat, use TCP for file transfer.

Casey Balza
  • 152
  • 1
  • 12