Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> Accept(): Invalid Argument?
post Jul 27 2004, 12:22 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 2
Joined: 28-June 04
Member No.: 3,247

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.
Go to the top of the page
+Quote Post

Posts in this topic
- bonhomme   Accept(): Invalid Argument?   Jul 27 2004, 12:22 PM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 21st July 2018 - 03:52 PM