|
20 | 20 | #' |
21 | 21 | #' Creates a new Dialer and binds it to a Socket. |
22 | 22 | #' |
| 23 | +#' To view all Dialers bound to a socket use \code{$dialer} on the socket, which |
| 24 | +#' returns a list of Dialer objects. To access any individual Dialer (e.g. to |
| 25 | +#' set options on it), index into the list e.g. \code{$dialer[[1]]} to return |
| 26 | +#' the first Dialer. |
| 27 | +#' |
| 28 | +#' A Dialer is an external pointer to a dialer object, which creates a single |
| 29 | +#' outgoing connection at a time. If the connection is broken, or fails, the |
| 30 | +#' dialer object will automatically attempt to reconnect, and will keep doing so |
| 31 | +#' until the dialer or socket is destroyed. |
| 32 | +#' |
23 | 33 | #' @param socket a Socket. |
24 | 34 | #' @param url [default 'inproc://nanonext'] a URL to dial, specifying the |
25 | | -#' transport and address as a character string e.g. 'inproc://anyvalue' or |
26 | | -#' 'tcp://127.0.0.1:5555' (see \link{transports}). |
| 35 | +#' transport and address as a character string e.g. 'inproc://anyvalue' or |
| 36 | +#' 'tcp://127.0.0.1:5555' (see \link{transports}). |
27 | 37 | #' @param tls [default NULL] for secure tls+tcp:// or wss:// connections only, |
28 | | -#' provide a TLS configuration object created by \code{\link{tls_config}}. |
| 38 | +#' provide a TLS configuration object created by \code{\link{tls_config}}. |
29 | 39 | #' @param autostart [default TRUE] whether to start the dialer (by default |
30 | | -#' asynchronously). Set to NA to start synchronously - this is less |
31 | | -#' resilient if a connection is not immediately possible, but avoids subtle |
32 | | -#' errors from attempting to use the socket before an asynchronous dial has |
33 | | -#' completed. Set to FALSE if setting configuration options on the dialer as |
34 | | -#' it is not generally possible to change these once started. |
| 40 | +#' asynchronously). Set to NA to start synchronously - this is less resilient |
| 41 | +#' if a connection is not immediately possible, but avoids subtle errors from |
| 42 | +#' attempting to use the socket before an asynchronous dial has completed. Set |
| 43 | +#' to FALSE if setting configuration options on the dialer as it is not |
| 44 | +#' generally possible to change these once started. |
35 | 45 | #' @param error [default FALSE] behaviour on error: if FALSE, returns an integer |
36 | | -#' exit code accompanied by a warning, or, if TRUE, generates an error and |
37 | | -#' halts execution. |
| 46 | +#' exit code accompanied by a warning, or, if TRUE, generates an error and |
| 47 | +#' halts execution. |
38 | 48 | #' |
39 | 49 | #' @return Invisibly, an integer exit code (zero on success). A new Dialer |
40 | | -#' (object of class \sQuote{nanoDialer} and \sQuote{nano}) is created and |
41 | | -#' bound to the Socket if successful. |
42 | | -#' |
43 | | -#' @details To view all Dialers bound to a socket use \code{$dialer} on the |
44 | | -#' socket, which returns a list of Dialer objects. To access any individual |
45 | | -#' Dialer (e.g. to set options on it), index into the list e.g. |
46 | | -#' \code{$dialer[[1]]} to return the first Dialer. |
47 | | -#' |
48 | | -#' A Dialer is an external pointer to a dialer object, which creates a |
49 | | -#' single outgoing connection at a time. If the connection is broken, or |
50 | | -#' fails, the dialer object will automatically attempt to reconnect, and |
51 | | -#' will keep doing so until the dialer or socket is destroyed. |
| 50 | +#' (object of class \sQuote{nanoDialer} and \sQuote{nano}) is created and |
| 51 | +#' bound to the Socket if successful. |
52 | 52 | #' |
53 | 53 | #' @section Further details: |
54 | 54 | #' |
55 | | -#' Dialers and Listeners are always associated with a single socket. A |
56 | | -#' given socket may have multiple Listeners and/or multiple Dialers. |
| 55 | +#' Dialers and Listeners are always associated with a single socket. A given |
| 56 | +#' socket may have multiple Listeners and/or multiple Dialers. |
57 | 57 | #' |
58 | | -#' The client/server relationship described by dialer/listener is completely |
59 | | -#' orthogonal to any similar relationship in the protocols. For example, a |
60 | | -#' rep socket may use a dialer to connect to a listener on an req socket. |
61 | | -#' This orthogonality can lead to innovative solutions to otherwise |
62 | | -#' challenging communications problems. |
| 58 | +#' The client/server relationship described by dialer/listener is completely |
| 59 | +#' orthogonal to any similar relationship in the protocols. For example, a rep |
| 60 | +#' socket may use a dialer to connect to a listener on an req socket. This |
| 61 | +#' orthogonality can lead to innovative solutions to otherwise challenging |
| 62 | +#' communications problems. |
63 | 63 | #' |
64 | | -#' Any configuration options on the dialer/listener should be set by |
65 | | -#' \code{\link{opt<-}} before starting the dialer/listener with |
66 | | -#' \code{\link{start}}. |
| 64 | +#' Any configuration options on the dialer/listener should be set by |
| 65 | +#' \code{\link{opt<-}} before starting the dialer/listener with |
| 66 | +#' \code{\link{start}}. |
67 | 67 | #' |
68 | | -#' Dialers/Listeners may be destroyed by \code{\link{close}}. They are also |
69 | | -#' closed when their associated socket is closed. |
| 68 | +#' Dialers/Listeners may be destroyed by \code{\link{close}}. They are also |
| 69 | +#' closed when their associated socket is closed. |
70 | 70 | #' |
71 | 71 | #' @examples |
72 | 72 | #' socket <- socket("rep") |
@@ -94,42 +94,42 @@ dial <- function(socket, url = "inproc://nanonext", tls = NULL, autostart = TRUE |
94 | 94 | #' |
95 | 95 | #' Creates a new Listener and binds it to a Socket. |
96 | 96 | #' |
| 97 | +#' To view all Listeners bound to a socket use \code{$listener} on the socket, |
| 98 | +#' which returns a list of Listener objects. To access any individual Listener |
| 99 | +#' (e.g. to set options on it), index into the list e.g. \code{$listener[[1]]} |
| 100 | +#' to return the first Listener. |
| 101 | +#' |
| 102 | +#' A listener is an external pointer to a listener object, which accepts |
| 103 | +#' incoming connections. A given listener object may have many connections at |
| 104 | +#' the same time, much like an HTTP server can have many connections to multiple |
| 105 | +#' clients simultaneously. |
| 106 | +#' |
97 | 107 | #' @inheritParams dial |
98 | 108 | #' @param autostart [default TRUE] whether to start the listener. Set to FALSE |
99 | | -#' if setting configuration options on the listener as it is not generally |
100 | | -#' possible to change these once started. |
| 109 | +#' if setting configuration options on the listener as it is not generally |
| 110 | +#' possible to change these once started. |
101 | 111 | #' |
102 | 112 | #' @return Invisibly, an integer exit code (zero on success). A new Listener |
103 | | -#' (object of class \sQuote{nanoListener} and \sQuote{nano}) is created and |
104 | | -#' bound to the Socket if successful. |
105 | | -#' |
106 | | -#' @details To view all Listeners bound to a socket use \code{$listener} on the |
107 | | -#' socket, which returns a list of Listener objects. To access any |
108 | | -#' individual Listener (e.g. to set options on it), index into the list e.g. |
109 | | -#' \code{$listener[[1]]} to return the first Listener. |
110 | | -#' |
111 | | -#' A listener is an external pointer to a listener object, which accepts |
112 | | -#' incoming connections. A given listener object may have many connections |
113 | | -#' at the same time, much like an HTTP server can have many connections to |
114 | | -#' multiple clients simultaneously. |
| 113 | +#' (object of class \sQuote{nanoListener} and \sQuote{nano}) is created and |
| 114 | +#' bound to the Socket if successful. |
115 | 115 | #' |
116 | 116 | #' @section Further details: |
117 | 117 | #' |
118 | | -#' Dialers and Listeners are always associated with a single socket. A |
119 | | -#' given socket may have multiple Listeners and/or multiple Dialers. |
| 118 | +#' Dialers and Listeners are always associated with a single socket. A given |
| 119 | +#' socket may have multiple Listeners and/or multiple Dialers. |
120 | 120 | #' |
121 | | -#' The client/server relationship described by dialer/listener is completely |
122 | | -#' orthogonal to any similar relationship in the protocols. For example, a |
123 | | -#' rep socket may use a dialer to connect to a listener on an req socket. |
124 | | -#' This orthogonality can lead to innovative solutions to otherwise |
125 | | -#' challenging communications problems. |
| 121 | +#' The client/server relationship described by dialer/listener is completely |
| 122 | +#' orthogonal to any similar relationship in the protocols. For example, a rep |
| 123 | +#' socket may use a dialer to connect to a listener on an req socket. This |
| 124 | +#' orthogonality can lead to innovative solutions to otherwise challenging |
| 125 | +#' communications problems. |
126 | 126 | #' |
127 | | -#' Any configuration options on the dialer/listener should be set by |
128 | | -#' \code{\link{opt<-}} before starting the dialer/listener with |
129 | | -#' \code{\link{start}}. |
| 127 | +#' Any configuration options on the dialer/listener should be set by |
| 128 | +#' \code{\link{opt<-}} before starting the dialer/listener with |
| 129 | +#' \code{\link{start}}. |
130 | 130 | #' |
131 | | -#' Dialers/Listeners may be destroyed by \code{\link{close}}. They are also |
132 | | -#' closed when their associated socket is closed. |
| 131 | +#' Dialers/Listeners may be destroyed by \code{\link{close}}. They are also |
| 132 | +#' closed when their associated socket is closed. |
133 | 133 | #' |
134 | 134 | #' @examples |
135 | 135 | #' socket <- socket("req") |
@@ -159,11 +159,11 @@ listen <- function(socket, url = "inproc://nanonext", tls = NULL, autostart = TR |
159 | 159 | #' |
160 | 160 | #' @param x a Listener or Dialer. |
161 | 161 | #' @param async [default TRUE] (applicable to Dialers only) logical flag whether |
162 | | -#' the connection attempt, including any name resolution, is to be made |
163 | | -#' asynchronously. This behaviour is more resilient, but also generally |
164 | | -#' makes diagnosing failures somewhat more difficult. If FALSE, failure, |
165 | | -#' such as if the connection is refused, will be returned immediately, and |
166 | | -#' no further action will be taken. |
| 162 | +#' the connection attempt, including any name resolution, is to be made |
| 163 | +#' asynchronously. This behaviour is more resilient, but also generally makes |
| 164 | +#' diagnosing failures somewhat more difficult. If FALSE, failure, such as if |
| 165 | +#' the connection is refused, will be returned immediately, and no further |
| 166 | +#' action will be taken. |
167 | 167 | #' @param ... not used. |
168 | 168 | #' |
169 | 169 | #' @return Invisibly, an integer exit code (zero on success). |
|
0 commit comments