Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site trwspp.UUCP
Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!trwrb!trwspp!aoki
From: aoki@trwspp.UUCP
Newsgroups: net.bugs.4bsd
Subject: reposting:  sockets problem
Message-ID: <458@trwspp.UUCP>
Date: Wed, 6-Jun-84 16:23:09 EDT
Article-I.D.: trwspp.458
Posted: Wed Jun  6 16:23:09 1984
Date-Received: Fri, 8-Jun-84 01:34:34 EDT
Organization: T R W, Redondo Beach, CA
Lines: 58

[are you hungry?????]

Here a problem for all you 4.2 wizards :::::

	The problem is this.  We have been playing with sockets, and
    have been experiencing very slow response time.

	(taking the code from the IPC Primer)
	When a single link to the server was created, communications
    seems to work properly.  However, when multiple links were made to
    the server (4 to be exact), after several iterations of send and
    receive between server and clients, the client seems to hang.  We
    only think that the problem is in the client, we're not sure.

	Include here a portion of the code:
	
	int	sd;
	int	nsd1, nsd2, nsd3, nsd4;
	struct	sockaddr_in 	from;
	char	msg[100],
		ack[100];

	listen(sd, 4);
	
	nsd1 = accept(sd, &from, &len);
	nsd2 = accept(sd, &from, &len);
	nsd3 = accept(sd, &from, &len);
	nsd4 = accept(sd, &from, &len);
	.
	.
	.
	while (1) {
		cntr = recv(nsd1, msg, sizeof(msg), 0);
		if (cntr != ERROR) {
			cntr = send(nsd1, ack, sizeof(ack), 0);
		}
		.
		.(repeated for other links)
		.
	}
	
--------------------

	Any experiences with sockets you would like to share with me
    would be greatly appreciated.  (any other experiences with
    sockets other than the problem mentioned would also appreciated)

	Before you say it, I have been reading net.unix-wizards.

	As they say, thanks in advance...

			::::: Dean K. Aoki :::::

			UUCP:  { ucbvax | decvax } !trwrb!trwspp!aoki
			ARPA:  !trwrb!trwspp!aoki@BERKELEY
			USPS:  T R W  Defense Systems Group
			       One Space Park  MS:  119-2142F
			       Redondo Beach, CA  90278