Ok...I am REALLY getting frustrated trying to figure this out!!! I am trying to create a client/server system that will be used in an upcoming game. I am trying to get the FD_xx options to work correctly. Can someone please take a look at this and tell me what (if anything) I am doing wrong? The problem I am getting now is when I run the server, then the client...The server picks up that the client has sent data. Good...it should. But when I go to READ that data...I get the WinSock error: 10014 - WSAEFAULT. The description from Microsoft's docs:-------------------------------------------------------------------------------------WSAFAULT (10014): Bad address. The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument which is a struct sockaddr is smaller than sizeof(struct sockaddr).-------------------------------------------------------------------------------------[EDIT]Also: I sometimes get:WSAECONNABORTED (10053) Software caused connection abort. An established connection was aborted by the software in your host machine, possibly due to a data transmission timeout or protocol error. -------------------------------------------------------------------------------------The client was not disconnected...it was still running! Does this mean this is a firewall issue? It is just (well should be) running on the local machine, so I don't see why that would be an issue...::)I am probably missing something somewhere...but my eyes can't see it right now...please...anyone help?

--"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you.""It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

You use select to check whether you need to accept a new connection, or receive data. You are accepting when there is no need to do that. The code is complex because you did not do it in the standard way, were you using select to multiplex the information from the socket, it would be easier

Only question:How do I know when select will return the connection attempt?

Thanks for your quick response,Donald

--"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you.""It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Yes. I will tell you to check this again. When the connection is attempted, FD_ISSET will return true when you check the socket where you are listening. If FD_ISSET returns true in a socket that has already been accepted, then you are going to receive information.

/* check if the descriptor set is our listening one */if(FD_ISSET(descriptor , &input)){
sockets[sockets_index]= accept(descriptor, NULL, NULL);/* more code about accepting */}/* one of the sockets is sending data. Find it */else{/* receive information from a socket */}

Ok...Thanks man! It just gets frustrating after awhile...I didn't want to ask for help, but it looks like I needed to anyway...

The FD_xx is what was confusing for me... My docs are kind of hard to follow about how to use them correctly...

Thanks again,Donald

--"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you.""It’s so simple to be wise. Just think of something stupid to say and then don’t say it."