kjh@aplcen.apl.jhu.edu (Ken Heeres x8004) (02/27/90)
I am experimenting with socket programming using the PC/TCP development kit. I am using the example of a simple TCP application in the book UNIX Network Programming by W. Richard Stevens. I have two problems 1. When I try to compile the example client on page 286 I get an incompatible types error on the line: serv_addr.sin_addr.s_addr = inet_addr(SERV_HOST_ADDR); serv_addr is declared to be of type struct sockaddr_in. I looked in the header files and inet_addr is declared to be of type function returning in_addr. I tryed casting the return value to u_long which made the compiler choke. I then droped the s_addr off of the left hand side and the compiler(MSC5.1) took it. 2. The code that was produced does not work. I ran the same code with out the changes on a vax under ultrix and it works, so I figured my change was not benign. The client fails when it trys to write to the socket using write(). The error that I get back is: bad file number Can you shed some light on what I might be doing wrong? ken Heeres