sense you are using the accept function i'm assuming your making a server... so it's time for you to learn how to use multithreading.. that's probably the best way to do it.
As for your answer, it waits on the accept function until someone tries to connect.
I found these two great tutorials, which taught me everything i needed to know:
This one
and this one
Sorry if that's not exactly what your looking for, still a little too tired to be doing this this early [grin]
Hope that helps
~zix~
Edit: I was looking at those tutorials again, and i noticed i used _beginthread(function, NULL); instead of AFXBeginThread(), just so you know. Have to include process.h if you use my way though.
Edit2: I use a console, but it can be a win32 application... and i use commands both listen and accept, as you can probably see by the tutorials.
simple networking
Thanks alot, I will look through those tuts now, and with any luck, I will be able to get it working.
OK, Ive made a server, following the tut, and it seems to work, however when its running, Im getting a connection from 204.204.204.204 constantly. Im using a wireless router, which it could be, but Im not sure. If it is then what can I do about it?
I was looking around and found this thread, and he had the same problem you did.
Thread here Google is very useful you know.
If you are having the same problem he was, it's simply a problem with the accept..
Hope i could be of help
~zix~
Thread here Google is very useful you know.
If you are having the same problem he was, it's simply a problem with the accept..
Quote:
Thanks. It was a problem @ accept(); I had to put the last param.
ret = sizeof(struct sockaddr);
sckClient = accept(sckListen,(LPSOCKADDR)&clientN,&ret);
Hope i could be of help
~zix~
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement