Hi guys,

I'm trying to create a simple server using C. I'm running RH 7.2. When my code runs the following code segment, it returns with the following error:

accept(): invalid argument

I'm not sure why I'm getting this message since my arguments seem to be of the correct type. Anyway, here's my code:

for (;;)
  struct sockaddr_in clientName = {0};
  int slaveSocket, clientLength = sizeof(clientName);

  (void) memset(&clientName, 0, sizeof(clientName));

  slaveSocket = accept(serverSocket, (struct sockaddr *) &clientName, &clientLength);

  if (-1 == slaveSocket)

/* irrelevant code follows */

Anyone have any suggestions? Thanks.