similar to: socket connection in while(TRUE) loop the best way?

Displaying 20 results from an estimated 70000 matches similar to: "socket connection in while(TRUE) loop the best way?"

2006 Feb 05
2
R socket communication
Hello, I tried to code a R socket server but I did not succeed. The problem is that once the R socket server is created, I call the readLines function and then R gets blocked. The client seems to work fine since I tested it with a PERL server. I tried many combination of params in the socketConnection but none of them worked. I have seen some examples where the server sends something to a client
2006 Nov 08
1
get compressed data via a socket connection
Dear R developers I am currently working on the seqinR package. The seqinR package allows a remote access to biological databases via a socket connection. We are using the functions socketConnection, writeLines and readLines to open the socket, send request to the server and receive response from the server respectively. Recently, a new function implemented in the socket server allows
2005 Feb 17
1
socket problems (maybe bugs?)
Dear R Gurus, for some purpose i have to use a socket connection, where i have to read and write both text and binary data (each binary data package will be preceeded by a header line). When experimenting, i encountered some problems (with R-2.0.1 under different Linuxes (SuSE and Gentoo)). Since the default mode for socket connections is non-blocking, i first tried socketSelect() in order to
2008 Dec 16
0
socket server, textConnection and readLines
Hello; This is bit long email but hope someone can guide me. I have questions regarding socket, readLines and textConnection. I am not sure if my code is efficient (due to textConnection) and how to handle client disconnect and restart of the socket server in R. I have a huge(3.5+G) text file on machine 'A', which I want to process on machine 'B' using read.table (one line or a
2009 May 16
2
newbie: closing unused connection + readline
Hello; I am new to R and trying to read a line from socket connection at a time but at the end of script I am getting "closing unused connection" warning. I am not able to understand how to solve this. I want to read a line from socket and then use read.table/scan on that line but it looks like I am opening multiple connections instead of just one. I think I am doing something wrong or
2006 Jul 21
1
Problems Reading from Socket
My followup question went unanswered in another thread, so I thought I'd start a new one and rephrase it. I need to use CGI POST to retrieve data from a server, so thanks to Duncan's suggestion, I used the httpRequest package as example code for doing so. BUT, I have another problem. The data retrieved from the socket has occasional problems. I include example code below to
2016 Jan 15
1
Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", : cannot open the connection
Dear All I have sucessfully created cluster of four nodes using localhost in my local machine by executing the following command > cl<-makePSOCKcluster(c(rep("localhost",4)),outfile='',homogeneous=FALSE,port=11001) starting worker pid=4271 on localhost:11001 at 12:12:26.164 starting worker pid=4280 on localhost:11001 at 12:12:26.309 starting worker pid=4289 on
2001 Jul 30
0
Remote controlling R via sockets
Many thanks to the R core team for their work on R connections. I was delighted to discover that it is now possible to remote-control R-1.3.0 via a socket connection - something which Brian Ripley noted was not yet possible with R-1.2.0 back in January 2001 in the first R News newsletter. How? Just substitute source() for readLines() in last few lines of the example for a socket connection given
2012 Feb 20
1
Time taken to process a file after a socket connection was made
Hello R people, I have created a '.csv' file of 100 rows by 20 columns whose each cell contains a random numbers between 0 & 1, thru a Java program. Once that is created a signal (just a letter) is send to the port of a socket connection at "localhost", which was earlier started by an "R" session. Now the "R" reads the '.csv' file into a data
2010 Sep 22
1
help with sockets in R
Hi R gurus, I'm trying to use a ReSTful web service from within R. Specifically, I need to make HTTP PUT requests. I'm able to make the request and that goes well enough, but I'm having trouble properly consuming the HTTP response. The problem comes in when I'm trying to parse out the response body. I get the length of the response body from the Content-Length header. I then try
2024 Feb 20
2
Tcl socket server (tcltk) does not work any more on R 4.3.2
Dear list, It seems that something changed between R 4.2.3 and R 4.3 (tested with 4.3.2) that broke the Tcl socket server. Here is a reproducible example: - R process #1 (Tcl socket server): library(tcltk) cmd <- r"( proc accept {chan addr port} { ;# Make a proc to accept connections puts "$addr:$port says [gets $chan]" ;# Receive a string puts $chan goodbye
2005 Apr 14
0
Finding an available port for server socket
I've written a Smalltalk application which starts R on another machine and then communicates with it via sockets. The functions involved are: slaveStart <- function(masterHost, masterPort){ inPort <- availablePort() sendSocket(as.character(inPort), masterHost, masterPort) socketSlave(inPort) } socketSlave <- function(inPort){ ## listens on inPort.
2018 Mar 09
0
parallel:::newPSOCKnode(): background worker fails immediately if socket on master is not set up in time (BUG?)
I just noticed that parallel:::.slaveRSOCK() passes 'timeout' to socketConnection() as a character, i.e. there's a missing timeout <- as.integer(timeout), cf. port <- as.integer(port) and useXDR <- as.logical(value): > parallel:::.slaveRSOCK function () { makeSOCKmaster <- function(master, port, timeout, useXDR) { port <- as.integer(port) con
2013 Jan 21
2
how to bread while loop reading from connection with read.csv
Hello, I'm trying to read a file rows at a time, so as to not read the entire file into memory.? When reading the "connections" and "readLines" help, and "R help archive," it seems this should be possible with read.csv and a file connection, making use of the "nrows" argument, and checking where the "nrow()" of the new batch is zero rows.
2018 Mar 09
0
parallel:::newPSOCKnode(): background worker fails immediately if socket on master is not set up in time (BUG?)
I'm happy to look at a patch that does this. I'd start with a small interval and increase it by 50%, say, on each try wit a max retry time limit. This isn't eliminating the problem,only reducing the probability, but still worth it. I had considered doing something like this but it didn't seem necessary at the time. You don't want to retry indefinitely since the connection
2001 Oct 02
1
problem with while loop with next (was RE: file connection, w hile, readLines and browser)
Dear R-help, I think I have kinda isolated the problem I had to the following: i <- 0 while( {i <- i + 1} < 5) { if(i < 3) next print(i) } This seems to go into an infinite loop. After I break the execution, i has the value 1. At the R prompt, if I start from i <- 0 and keep typing {i <- i + 1} < 5, it eventually evaluate to TRUE. So why does the while loop not work?
2010 Jun 16
2
Sending a null byte to a socket
Hello, I am trying to write some code in R to communicate over sockets via the STOMP protocol (http://stomp.codehaus.org/Protocol). As you can see, a null byte (ASCII 0) is used as the "over" signal. I'd like to be able to do something like this: write.socket(socket, "CONNECT\nlogin: me\npasscode: pass\n\n\000") However, R does not like it when you put "\000"
2018 Mar 10
1
parallel:::newPSOCKnode(): background worker fails immediately if socket on master is not set up in time (BUG?)
Great. For the record of this thread, I've submitted patch PR17391 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17391). I've patched it against the latest R-devel on the SVN, passes 'make check-all', and I've verified it works with the above tests. /Henrik On Fri, Mar 9, 2018 at 4:37 AM, <luke-tierney at uiowa.edu> wrote: > I'm happy to look at a
2018 Mar 09
2
parallel:::newPSOCKnode(): background worker fails immediately if socket on master is not set up in time (BUG?)
BACKGROUND: While troubleshooting random, occasionally occurring, errors from parallel::makePSOCKcluster("localhost", port = 11000); Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE, : cannot open the connection I had another look at parallel:::newPSOCKnode(), which is used internally to set up each background worker. It is designed to,
2003 Oct 16
0
Too long to open a socket connection
Hello Guys! I've been doing data aquisition of a pressure measurement system that communicates using TCP/IP protocol. R's socket connection has been a blessing for aquiring this data. I've been doing this data aquisition on Linux (where I do most of the development) and Windows. It works fine on both systems but there is only a slight problem (not really a problem, something weird).