CASyncSockets: 10035: Operation would block

15/12/2003 - 18:48 por Albert Vila | Informe spam
Hello,
searching in google groups i've found this thread:

"Well, if you've never had the error before, it is a miracle. This is the
assumed return
code for an asynchronous socket that would block. You have to wait for the
notification
that the connection has completed (e.g., OnConnect). The assumption is
always that every
operation you try will return this code.
joe

On Tue, 26 Feb 2002 11:14:21 -0000, "Mark Firth" <no@email.address> wrote:


I am writing a network class derived from CASyncSocket and I am getting
socket error '10035: Socket is non-blocking and the specified
operation will block' when I try to connect to a listening socket.

I have done a similar thing before and have never had this error.

Can anyone tell me why this is happening and how I can solve it? as I can
not find any reference to it in the knowledge base

Thanks in advance
Mark"



I have the same problem (error 10035), and... sorry for my newbie question,
but: how can I wait for OnConnect event in my client? Have I to override the
OnConnect function, in order to work as I want? Are there a way to, e.g. put
a loop waiting for the event (while (!onConnect) {})?

As you can see, I don't have so much idea about windows sockets, so any
contribution will be really helpful.

Thank you very much,
Albert
 

Leer las respuestas

#1 Gabriel Gibaut
16/12/2003 - 04:52 | Informe spam
You have two options: poll on the Connect member until it returns something
different to 10035, or better, override the OnConnect event and forget the
value returned from Connect. OnConnect is going to be invoked later with
the result of the connection attempt. After that if your connection was
succesfully established you can start sending and receiving.

HTH

Gabriel

"Albert Vila" <bert29[@]casal.upc.es> escribió en el mensaje
news:brks72$4i6$
Hello,
searching in google groups i've found this thread:

"Well, if you've never had the error before, it is a miracle. This is the
assumed return
code for an asynchronous socket that would block. You have to wait for the
notification
that the connection has completed (e.g., OnConnect). The assumption is
always that every
operation you try will return this code.
joe

On Tue, 26 Feb 2002 11:14:21 -0000, "Mark Firth" wrote:

>I am writing a network class derived from CASyncSocket and I am getting
>socket error '10035: Socket is non-blocking and the specified
>operation will block' when I try to connect to a listening socket.
>
>I have done a similar thing before and have never had this error.
>
>Can anyone tell me why this is happening and how I can solve it? as I can
>not find any reference to it in the knowledge base
>
>Thanks in advance
>Mark"

I have the same problem (error 10035), and... sorry for my newbie


question,
but: how can I wait for OnConnect event in my client? Have I to override


the
OnConnect function, in order to work as I want? Are there a way to, e.g.


put
a loop waiting for the event (while (!onConnect) {})?

As you can see, I don't have so much idea about windows sockets, so any
contribution will be really helpful.

Thank you very much,
Albert


Preguntas similares