Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Binary data thru socket.c

Status
Not open for further replies.

vsunh

Programmer
Aug 23, 2003
52
0
0
AE
We have been using socket.c program available on Unix system to exchange ASCII data with external servers, now we have a requirement where we need to send & receive Binary data (sound file - .wav or .vox format).

Is it possible?
can any one send us the sample code for handling sound files thru socket C program?
 
No difference between text or binary data transmission on socket level. TCP channel is an octet stream, that's all.
One way or another a sender and a receiver must have any agreement about stream data format (to establish exchange protocol).
Or use standard high level protocol (FTP, for example) over sockets...
 
Many Thanks!!

but is the same true for sound files, what data format do we use?
 
It doesn't matter.

So long as you open your binary data file in binary mode, and pay attention to any length result when you read the file, it should all work just fine.



--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top