[net.unix-wizards] Need help with 4.2 Socket Communications

mason@utcsri.UUCP (Dave Mason) (04/01/85)

I am attempting to use the 4.2 Sockets communication system.

I am trying to use DATAGRAM sockets in the Unix domain and am having
some problems.  The server looks like:
	s = socket(...
	bind(s,...
	...
	if (recvfrom(s,buf,buflen,0,&from,&fromlen)<0) ...
	... process the data ...
	if (sendto(s,buf,buflen,0,&from,fromlen)<0) {
		perror(...
		abort
		}
the client looks like:
	sc = socket(...
	connect(sc,...
	if (send(s,...
	if (recv(s,...
The message gets sent properly and received by the server, but the
sendto fails with the ENOTSOCK claiming that the socket s is no longer
a socket.  Could someone explain to me (by mail please, I can no longer
find the time to read net.unix-wizards) why this would be, and what I
can do about it.
	Thanks	../Dave
-- 
Usenet:	{dalcs dciem garfield musocs qucis sask titan trigraph ubc-vision
 	 utzoo watmath allegra cornell decvax decwrl ihnp4 uw-beaver}
	!utcsri!mason		Dave Mason, U. Toronto CSRI
CSNET:	mason@Toronto
ARPA:	mason%Toronto@CSNet-Relay