Re: [Rd] Possible changes to connections

From: mel <mel_at_altk.com>
Date: Fri, 01 Jun 2007 08:24:14 +0200

Prof Brian Ripley a écrit :

>> I use getConnection().
>> In the context in which I use it, the number of the connection is
>> known a priori.

> 
> I don't see how you can know it 'a priori': it is an implementation detail
> (and since R itself uses connections, those details could easily change).

(disclaimer : I don't claim its the best way to proceed)

Before launching my app, the connections context is :  > showConnections(all=TRUE)

   description class      mode text   isopen   can read can write
0 "stdin"     "terminal" "r"  "text" "opened" "yes"    "no"
1 "stdout"    "terminal" "w"  "text" "opened" "no"     "yes"
2 "stderr"    "terminal" "w"  "text" "opened" "no"     "yes"

So, the call to socketConnections() creates always (at least for all my experiments) a connection with number 3. Btw, if (socketConnections(...) != 3) the application simply don't launch.
So, if the application runs, it's sure that this is with a connection number==3.
That's why I say that "the number of the connection is known a priori".

Of course, the connection number could also be retrieved eg using the description field.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 01 Jun 2007 - 06:37:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 01 Jun 2007 - 08:34:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.