[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

network connection state

Lloyd Dupont

10/9/2003 2:02:00 PM

I have an application which pool network connection as they are made.
and I want to check on the opened one if there is any data available.

would it be only for socket I know I have 2 option:
call Poll() or Select()

Select() is not really proper as the number of socket could grow dynamically
anytime (or is it, could I Abort() my Select() thread ?)
so I was thinking to Poll() every single socket, in order not to have
pending data on a Socket I was thinking to loop through the socket and call
Poll() with a 0 millisecond timeout.

Also my app has pipe as IPC, and I was thinking to use te DataAvailable
property of stream instead of doing socket specific stuff and coninuously
loop through connection in the background.

what about that ?
any suggestion ?


2 Answers

Ron Alberda [MSFT]

10/21/2003 10:50:00 PM

0

Poll would be the best option.

-Ron

"Lloyd Dupont" <net.galador@ld> wrote in message
news:%23svS13mjDHA.3612@TK2MSFTNGP11.phx.gbl...
> I have an application which pool network connection as they are made.
> and I want to check on the opened one if there is any data available.
>
> would it be only for socket I know I have 2 option:
> call Poll() or Select()
>
> Select() is not really proper as the number of socket could grow
dynamically
> anytime (or is it, could I Abort() my Select() thread ?)
> so I was thinking to Poll() every single socket, in order not to have
> pending data on a Socket I was thinking to loop through the socket and
call
> Poll() with a 0 millisecond timeout.
>
> Also my app has pipe as IPC, and I was thinking to use te DataAvailable
> property of stream instead of doing socket specific stuff and coninuously
> loop through connection in the background.
>
> what about that ?
> any suggestion ?
>
>


Lloyd Dupont

10/28/2003 11:20:00 AM

0

Hi Ron !
It's all solved elegantly now !
I just find your message, too late ;-)

"Ron Alberda [MSFT]" <ronalda@online.microsoft.com> a écrit dans le message
de news:OD$qsWCmDHA.2404@TK2MSFTNGP12.phx.gbl...
> Poll would be the best option.
>
> -Ron
>
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:%23svS13mjDHA.3612@TK2MSFTNGP11.phx.gbl...
> > I have an application which pool network connection as they are made.
> > and I want to check on the opened one if there is any data available.
> >
> > would it be only for socket I know I have 2 option:
> > call Poll() or Select()
> >
> > Select() is not really proper as the number of socket could grow
> dynamically
> > anytime (or is it, could I Abort() my Select() thread ?)
> > so I was thinking to Poll() every single socket, in order not to have
> > pending data on a Socket I was thinking to loop through the socket and
> call
> > Poll() with a 0 millisecond timeout.
> >
> > Also my app has pipe as IPC, and I was thinking to use te DataAvailable
> > property of stream instead of doing socket specific stuff and
coninuously
> > loop through connection in the background.
> >
> > what about that ?
> > any suggestion ?
> >
> >
>
>