March 20, 2004 Re: Socket stream | ||||
---|---|---|---|---|
| ||||
Posted in reply to Phill | Hehe 8). You'll prolly have to set a timeout , or use asynch sockets . A listener thread is usually the route i take with blocking sockets. C On Sun, 21 Mar 2004 08:35:02 +1100, Phill <phill@pacific.net.au> wrote: > or would you believe blocking bit?. > > > "Phill" <phill@pacific.net.au> wrote in message > news:c3ida2$1m56$1@digitaldaemon.com... >> Isnt there a "blocking" bool there in the socket >> class? Maybe that could do the trick? >> >> Phill >> >> "C. Sauls" <ibisbasenji@yahoo.com> wrote in message >> news:c3i402$16p5$1@digitaldaemon.com... >> > Hmm.. now if only SockeStream.readLine() didn't block when there's no >> > data from the socket... has to be a way to set that up, or should I >> > thread it out... hmm. (Haven't touched sock code in forever, having >> to >> > re-learn everything.) >> > >> > -C. Sauls >> > -Invironz >> >> > > -- D Newsgroup. |
March 20, 2004 Re: Socket stream | ||||
---|---|---|---|---|
| ||||
Posted in reply to Phill | Phill wrote: > Isnt there a "blocking" bool there in the socket > class? Maybe that could do the trick? > > Phill Yes, but you can't call receive() on a nonblocking socket unless you've been notified of readability by select(). I think SocketStream will always only be for blocking sockets. I have ideas for a nonblocking alternative, with events and built in timers. -- Christopher E. Miller |
March 21, 2004 Re: Socket stream | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | The specs for the project I'm thinking of including it in calls for a threaded socket system anyhow, so that's the route I'm likely to go. I just thought it might be nice to be able to avoid it at times.
-C. Sauls
-Invironz
C wrote:
> Hehe 8). You'll prolly have to set a timeout , or use asynch sockets . A listener thread is usually the route i take with blocking sockets.
>
> C
|
March 21, 2004 Re: Socket stream | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | Now using events is an interesting idea... I could envision working that paradigm into this project if you got it working.. at least maybe for the sockets opened by the internal scripting engine, while threading the hardcoded socket bindings...
-C. Sauls
-Invironz
Vathix wrote:
> Phill wrote:
>
>> Isnt there a "blocking" bool there in the socket
>> class? Maybe that could do the trick?
>>
>> Phill
>
>
> Yes, but you can't call receive() on a nonblocking socket unless you've been notified of readability by select(). I think SocketStream will always only be for blocking sockets. I have ideas for a nonblocking alternative, with events and built in timers.
>
>
|
Copyright © 1999-2021 by the D Language Foundation