Socket Read/Write error
===

would install valgrind to tell me what the problem is, but unfortunately can'5 any new programs on this computer... Could anyone tell me if there's an obvious problem with this "echo" program? Doing this for a friend, so not sure what the layout of the client is on the other side, but I know that both reads and writes are valid socket descriptors, and I've tested that n = write(writes,"I got your message \n",20); and n = write(reads,"I got your message \n",20); both work so can confirm that it's not a case of an invalid fd. Thanks!

    int
    main( int argc, char** argv ) {

   
     int reads = atoi(argv[1]) ; 
     int writes = atoi(argv[3]) ; 
     int n ; 


      char buffer[MAX_LINE];
      memset(buffer, 0, sizeof(buffer));



      int i = 0 ; 
      while (1) {
	    read(reads, buffer, sizeof(buffer));
	    n = write(writes,buffer,sizeof(buffer));
	    if (n < 0)  perror("ERROR reading from socket"); 

      } 
