This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Winsock call to UNIX




> -----Original Message-----
> From: Zhang, John [mailto:John.Zhang@neonsoft.com]
> 
> I installed Be 20.1, finished porting on NT 40. compiled with
> libwinsock32.a.
> Now the socket calls work fine on NT when a client and a 
> server talking to
> each other.
> But when calling from NT to a UNIX (server or client), 
> sockets never go
> thru, i.e. a ported application cannot talk to the original UNIX
> application. 

Maybe a little/big endian issue? You cannot use constructions like this:

char *buf[SIZE];
int x;
/* read in the buffer here */
memcpy((void *)&x, buf+X_OFFSET, sizeof(int));   /* WRONG! */

You should use the htons() and htonl() functions on win32 in order to
correct the little/big endian problem.
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]