i want to send my char array of 1 MB through CSocket .. it Contains Sound data. How i typecast it or ,,,,,?
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I have a sound data in array of 1MB , how can i send it through CSocket class ... Is there any type ast needed.. if yes then how. will it loose data or not.. thanx
Check out this link for a reference to the API. To answer your question, if you create the socket with the SOCK_STREAM flag, then the TCP will be used and you will not lose any data since TCP is a reliable transport. However, if you want a potential speed-up in send times (at the risk of losing data), create the socket with the SOCK_DGRAM flag to create a UDP connection. The Send function takes data in the form of a void* (see above link for further reference). --Dean