On 14 Jul 2005 02:40:09 -0700,
pr***********@gmail.com
<pr***********@gmail.com> wrote:
I want to Transmit Data using Using Socket Programming in C. The only
Problem is that the data contains a lot of NULL characters in between
(it is an JPEG image data).so if I populate a Char array with the data
and try transmitting using send() only a part of the data is sent,
since null character is taken as a end-of-line in C.
Is there any way that send() can ignore the null character and transmit
the entire data in the buffer.
(a) Sockets are not part of the C standard, and are therefore off topic
in comp.lang.c, try a newsgroup relevant to your operating system,
for example:
comp.unix.programmer
comp.os.linux.networking
comp.os.ms-windows.apps.winsock.misc
comp.os.ms-windows.networking.tcp-ip
(b) A null character is not "taken as a end-of-line in C", the end of
line character is '\n'. A null character is use to indicate the end
of a string by the string functions and is otherwise treated as
data.
(c) [OFF TOPIC]
The send() function in Unix (and as far as I know Windows Sockets)
sends as many characters as its parameter specifies, it doesn't
handle null characters (or any other character value) specially.
Perhaps you are trying to use strlen() to determine the length? Or
perhaps the receiving program is treating the received data as a
string?
[/OFF TOPIC]
Chris C