Message-Id: <199903182141.QAA13199@delorie.com> Comments: Authenticated sender is From: "George Foot" To: Edward Hill Date: Thu, 18 Mar 1999 21:39:23 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: rsxntdj + winsock CC: djgpp AT delorie DOT com X-mailer: Pegasus Mail for Win32 (v2.42a) Reply-To: djgpp AT delorie DOT com On 18 Mar 99 at 16:03, Edward Hill wrote: > I got rsxntdj working and now I'd like to try and write > a program that uses winsock. > > I was delighted to see a winsock.h in the include directory ... but I found that it's not quite right. Some things in it have been changed from the original version, which I think is a bad thing since it's effectively an interface to the DLLs. But I don't know too much about this. I overwrote it with a winsock.h from some Winsock documentation I found, and it works better now. IIRC the problems I had were with the FD_* macros used with `select'. There's an obvious clash here with the libc library function but I think it's OK provided you don't try to use the libc function for anything -- since the import library appears on the command line before the (implicit) `-lc' the function from the import library (so effectively the one from the DLL) will be used instead of the libc version. > I tried a makelib c:\windows\winsock.dll -o winsock.a > but it told me that it was 16 bit and wouldn't do it. > > So I tried a makelib c:\windows\system\wsock32.dll -o wsock.a > this worked and I got a .a file. IIRC that's what I found too. > I just can't seem to get any sample winsock files working. > I am using -lwsock32 an -Zwin32. > > I was wondering if anybody out there has a sample winsock > peice of code they could post that works for them (small > would be nice) so I can make sure it's not something I'm doing > wrong. OK, here are a couple of programs that work fine for me. Run the receiver first; it opens a socket and waits for data to be sent. Then run the sender, and tell it the address of the receiver and the port number the receiver printed. It will send a message; the receiver will tell you what was sent. The zip is about 1.5k. http://users.ox.ac.uk/~mert0407/RSXWSOCK.ZIP Note the capitalisation of the filename, Windows's FTP program seems to have a habit of doing that. -- George