Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #849

Re: socket programming. read from server.

From Rainer Weikusat <rweikusat@mssgmbh.com>
Newsgroups comp.unix.programmer
Subject Re: socket programming. read from server.
Date 2011-06-22 16:42 +0100
Message-ID <87k4cdan4e.fsf@sapphire.mobileactivedefense.com> (permalink)
References <88dc219d-5c3e-4d01-8b32-5280eaffcd04@l6g2000vbn.googlegroups.com>

Show all headers | View raw


Steve Richter <stephenrichter@gmail.com> writes:

[...]

> I am writing a small ftp client in C for the IBM AS400 using the UNIX
> APIs. When the client code connects to the FTP server it reads back
> the initial welcome messages. My code reads from the server, gets
> some /r terminated messages. Reads again and gets more /r terminated
> welcome messages. Then reads a 3rd time and blocks because there is
> nothing more to read.  What in the socket protocol tells me the 3rd
> read is going to block?

Nothing. The FTP protocol definition (RFC959), however, would tell you
that a server reply is either a single line reply composed of a
3-digit reply code, followed by an ASCII space character (0x20),
possibly followed by some informative text and terminated by a telnet
end-of-line sequence (ASCII CR, ASCII LF), or that it is a multiline
reply. In the latter case the first line will have a hypen (-) instead
of a space after the reply code and the last line will start with the
same reply code as the first, this time followed by a space.

More details:

	http://www.faqs.org/rfcs/rfc959.html

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

socket programming. read from server. Steve Richter <stephenrichter@gmail.com> - 2011-06-22 06:37 -0700
  Re: socket programming. read from server. Steve Richter <stephenrichter@gmail.com> - 2011-06-22 08:12 -0700
  Re: socket programming. read from server. Richard Kettlewell <rjk@greenend.org.uk> - 2011-06-22 16:31 +0100
  Re: socket programming. read from server. Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-06-22 16:42 +0100
  Re: socket programming. read from server. David Schwartz <davids@webmaster.com> - 2011-06-22 09:00 -0700
    Re: socket programming. read from server. Steve Richter <stephenrichter@gmail.com> - 2011-06-22 09:05 -0700
  Re: socket programming. read from server. "Heinrich Wolf" <invalid@invalid.invalid> - 2011-06-22 22:50 +0200
  Re: socket programming. read from server. Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-06-22 22:22 -0400
    Re: socket programming. read from server. Michael Press <rubrum@pacbell.net> - 2011-06-24 14:08 -0700

csiph-web