From owner-freebsd-net Mon May 15 9:26:57 2000 Delivered-To: freebsd-net@freebsd.org Received: from mail.surf1.de (mail.surf1.de [194.25.165.21]) by hub.freebsd.org (Postfix) with ESMTP id 1204237B578 for ; Mon, 15 May 2000 09:26:47 -0700 (PDT) (envelope-from alex@cichlids.com) Received: from cichlids.com (p3E9C1148.dip0.t-ipconnect.de [62.156.17.72]) by mail.surf1.de (8.9.3/8.9.3) with ESMTP id GAA11759; Mon, 15 May 2000 06:24:10 +0200 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by cichlids.com (Postfix) with ESMTP id A1E11AC2C; Mon, 15 May 2000 18:26:37 +0200 (CEST) Received: (from alex@localhost) by cichlids.cichlids.com (8.9.3/8.9.3) id SAA01005; Mon, 15 May 2000 18:26:35 +0200 (CEST) (envelope-from alex) Date: Mon, 15 May 2000 18:26:35 +0200 From: Alexander Langer To: Barney Wolff Cc: freebsd-net@FreeBSD.ORG Subject: Re: socket programming Message-ID: <20000515182635.A408@cichlids.cichlids.com> References: <3920178a0.244e@databus.databus.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" X-Mailer: Mutt 1.0.1i In-Reply-To: <3920178a0.244e@databus.databus.com>; from barney@databus.com on Mon, May 15, 2000 at 11:27:00AM -0400 X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Thus spake Barney Wolff (barney@databus.com): > Sigh. Quoting RFC 857: Either you are right and all telnet-clients I can use atm (Linux, Windows9x, FreeBSD) have implemented things wrong or maybe you are wrong. If you are right, I suggest you rewrite things and shout at the guys that they have implemented the protocol wrongly and send them patches. In this case, I was also right, since I said the things have the same effect (on clients _I_ know, also, if this violates the RfC). I suggest trying out the attached source, with and without commented out the handshake and see, what happens. In your opinion this should have no effect since DONT ECHO doesn't mean that. Thanks Alex -- I need a new ~/.sig. --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="localecho.c" #include #include #include #include int main(int argc, char **argv) { int listenfd, sockfd; struct sockaddr_in servaddr, cliaddr; int on, clilen; char buf[10]; if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) exit(1); on = 1; if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int)) == -1) exit(1); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr = htonl(INADDR_ANY); servaddr.sin_port = htons(12345); if (bind(listenfd, (struct sockaddr *) & servaddr, sizeof(servaddr)) == -1) exit(1); if (listen(listenfd, 2) == -1) exit(1); clilen = sizeof(cliaddr); sockfd = accept(listenfd, (struct sockaddr *) & cliaddr, &clilen); write(sockfd, "\377\373\1\0", 4); for (;;) { printf("Received %i bytes...\n", read(sockfd, buf, 9)); } /* forever */ return (0); } --17pEHd4RhPHOinZp-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message