I will post my code. When I use WSAGetLastError(); it connect() fails, I have a MessageBox(...) with the error and it comes up and Async sockets won't start. I will attach my code!
I will post my code. When I use WSAGetLastError(); it connect() fails, I have a MessageBox(...) with the error and it comes up and Async sockets won't start. I will attach my code!
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
2 things.....
[list=1][*]itoa()'s third param is not the amount of chars in the buffer...it is the base....therefore for decimal use 10 instead of 100[*]The error returned is 10035. This I believe is because you are selecting a nonblocking socket and then trying to call select on it.....[/list=1]
What do I have to do to create a blocking socket so I can Async?
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
To tell you the truth I havent done this stuff in ages......but I guess the program should just listen after selecting up the socket.....
Have a search on google for more help, or wait for someone who remembers more about it than me...
:: damn I gotta read my winsock book again! ::
> What do I have to do to create a blocking socket so I can Async?
This is almost like saying freezer burn or jumbo shrimp...it just doesn't work . Blocking and asynchronous sockets are two very different things; blocking sockets will not return during a function call until something happens, while asynchronous sockets are more like the Windows message system we've all grown to love and post notifications.
You might want to visit http://www.hal-pc.org/~johnnie2/winsock.html and gamedev's async article. Beware of the latter tutorial...FD_READ is not nearly as easy as what it seems.
Regarding your questions in the previous post, you do not necessarily have to handle FD_CONNECT and FD_ACCEPT messages at all. In fact, FD_CONNECT is used almost exclusively in clients while servers interpret FD_ACCEPT. Like any other standard Winproc message, you can handle only what you want and disregard the rest.
I agree with Fordy on error 10035.
"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C