A C unix server with a windows client

S

Seth

Hi,
i have written i simple C server with Socket under linux. I have no
problem with a unix client, but if the client is written in C under
windows read and write does not work properly...
what should i do??

thanx

Davide
 
S

santosh

Seth said:
Hi,
i have written i simple C server with Socket under linux. I have no
problem with a unix client, but if the client is written in C under
windows read and write does not work properly...
what should i do??

I believe that sockets under Windows are significantly different from
the UNIX way.

Post to a Windows group like
<or
<or
<
and provide more details and code for your question.
 
W

Walter Roberson

i have written i simple C server with Socket under linux. I have no
problem with a unix client, but if the client is written in C under
windows read and write does not work properly...
what should i do??

You should ask in a Windows programming newsgroup. The C standards
do not specify anything about networking at all; as far as the
C language is concerned, both OSs are operating correctly.
 
A

Al Balmer

Hi,
i have written i simple C server with Socket under linux. I have no
problem with a unix client, but if the client is written in C under
windows read and write does not work properly...
what should i do??
Two choices:

1. Only run it under Linux.
2. Ask in a Windows programming group.
 
C

CBFalconer

Seth said:
i have written i simple C server with Socket under linux. I have
no problem with a unix client, but if the client is written in C
under windows read and write does not work properly...
what should i do??

read and write are not standard C routines and thus are off-topic
here. Use fread and fwrite, along with fopen and fclose.
 
S

Stephen Sprunk

Seth said:
i have written i simple C server with Socket under linux. I have no
problem with a unix client, but if the client is written in C under
windows read and write does not work properly...
what should i do??

If you're reading and writing binary data, as opposed to text, then odds are
you're running into endianness and/or object size issues. You'd have the
same issue(s) if you were writing binary data to a file and trying to read
it on another platform.

The usual solution is to rewrite your code so that it uses either text data
or binary data in a well-defined format, e.g. "32-bit big-endian object"
rather than "int". ntohl() et al and <stdint.h> are quite helpful for such
tasks.

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top