Skip to content

Commit 58a8519

Browse files
committed
more resilient sync
1 parent d38e382 commit 58a8519

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

R/sync.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ unlock <- function(socket) invisible(.Call(rnng_socket_unlock, socket))
322322
#' @keywords internal
323323
#' @export
324324
#'
325-
.dispatcher <- function(host, url, tls = quote(expr =))
325+
.dispatcher <- function(host, url, tls = NULL)
326326
.Call(rnng_dispatcher_socket, host, url, tls)
327327

328328
#' Read Online Status

man/dot-dispatcher.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/thread.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static void rnng_dispatch_thread(void *args) {
547547
if (nng_rep0_open(&hsock))
548548
goto exitlevel1;
549549

550-
if (nng_dial(hsock, disp->host, &hdial, 0))
550+
if (nng_dial(hsock, disp->host, &hdial, NNG_FLAG_NONBLOCK))
551551
goto exitlevel2;
552552

553553
for (R_xlen_t i = 0; i < n; i++) {
@@ -668,8 +668,7 @@ static void rnng_dispatch_thread(void *args) {
668668

669669
SEXP rnng_dispatcher_socket(SEXP host, SEXP url, SEXP tls) {
670670

671-
const int sync = tls == R_MissingArg;
672-
const int sec = !sync && tls != R_NilValue;
671+
const int sec = tls != R_NilValue;
673672
const R_xlen_t nd = XLENGTH(url);
674673

675674
if (sec && NANO_TAG(tls) != nano_TlsSymbol)

0 commit comments

Comments
 (0)