LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Socket connection refused problem (http://www.linuxquestions.org/questions/linux-networking-3/socket-connection-refused-problem-365849/)

James_dean 09-22-2005 04:57 AM

Socket connection refused problem
 
I ran a very simple client, server program and it works fine with my own ip address but my connection gets timed out or refused for every other ip address outside my own computer. I am not using the fork command...should i?. All i want to do is to run a client program on one pc and server on another........send a message and get a response from the other pc. This should be easy enough but i don't know how to do it

Mara 09-23-2005 04:51 PM

I understand it timeouts or gets refused when you have one conection establilished? If that's the case, you need to make your server support more than one connection at once. Forking isn't a good idea, but threads or use of select() function is. For first time, select() is probably easier. Man page has a short example (not using sockets, but it's the same).


All times are GMT -5. The time now is 04:57 PM.