#include <stdio.h>


main()
{
  char c;
  int sock;

  setup_client_socket(SOCKET_NUM, &sock, getenv("HOST"), 1);

  /* repeatedly read from standard input and send to socket until EOF */
  while (1) {
	/* read a character from standard input */
	if ((c = getchar()) == EOF) break;

	/* send byte to server */
	if (send (sock, &c, 1, 0) != 1) {
		perror("CLIENT write error:"); break;
	}
  }
  close(sock);
}
