Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!kjh From: kjh@aplcen.apl.jhu.edu (Ken Heeres x8004) Newsgroups: comp.protocols.tcp-ip Subject: Problem with FTP's TCP/IP Keywords: FTP,sockets Message-ID: <4794@aplcen.apl.jhu.edu> Date: 27 Feb 90 12:31:15 GMT Organization: Johns Hopkins University, Laurel, MD Lines: 30 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