similar to: socket blocking with readBin

Displaying 20 results from an estimated 7000 matches similar to: "socket blocking with readBin"

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
2009 May 18
2
readBin on binary non-blocking connections (Windows & Unix differences/bugs)
R-devel: I am encountering a consistency issue using socketConnection and readBin with *non-blocking* connections on Unix and Windows XP (no Vista to test). I am a bit confused by the behavior of *non-blocking* connections under Windows specifically. When calling readBin on a non-blocking connection when there is no data to read on the socket, the connection under Unix will return a vector of
2004 May 27
0
blocking question with socketConnections
I am writing a function to make a multi-part form request with binary data. I am running R 1.8.1 on Linux ReadHat. The sockectConnection is initialized with open="a+b" and blocking=TRUE. After writing the Post request using writeChar and writeBin and flushing the connection I use socketSelect to check if the socketConnection is availabe for reading. This call consistently takes 15
2005 Oct 12
1
Questions about readBin function (Was: dec2bin?)
Hi, The latest version of R had some changes to functions "readbin() and writeBin() [which] now support raw vectors as well as filenames and connections.". As a result I am working on retiring "raw2bin" and "bin2raw" functions from "caTools" package which do exactly the same. Thanks to Prof. Ripley for bringing this change to my attention. Which brings me
2006 Jun 02
1
Typo fix for readBin.Rd
Hi, The man page for readBin has a small typo: --- a/src/library/base/man/readBin.Rd +++ b/src/library/base/man/readBin.Rd @@ -58,7 +58,7 @@ writeBin(object, con, size = NA, endian \code{readBin} and \code{writeBin} read and write C-style zero-terminated character strings. Input strings are limited to 10000 - characters. \code{\link{readChar}} and \code{\code{writeChar}} +
2008 Jan 23
0
writeBin doesn't "send" until readBin executed
Hi all - I'm playing around with an attempt to do some serial communication from within R to a microcontroller board. I open a connection: zz = file("/dev/ttyUSB0",open="a+") ## text mode ... when I execute writeLines("0",con=zz) I know the board receives the "0" because the board's serial comm LEDs light up when submit the command at the R
2002 Nov 29
2
readBin or writeBin adds extra nulls (PR#2333)
Full_Name: Ken Yap Version: 1.6.1 OS: Linux (SuSE 8.0) Submission from: (NULL) (129.78.64.5) I'm trying to copy a file using readBin and writeBin. (The reason is to be able to pipe PostScript or PDF output to a socket later, this is just an experiment.) I do: zz <- file("foo.ps", "rb") r <- readBin(zz, character(), 1000000) yy <- file("bar.ps",
2007 Dec 31
1
readBin differences on Windows and Linux/mac
I have been trying to use the gunzip function in the R.utils package. It opens a connection to a gzfile, uses readBin to read from that connection, and then uses writeBin to write out the raw data to a new file. This works as expected under linux/mac, but under Windows, I get: Error in readBin(inn, what= raw(0), size = 1, n=BFR.SIZE) : negative length vectors are not allowed A simple
2020 May 06
0
defining r audio connections
On 06/05/2020 1:09 p.m., frederik at ofb.net wrote: > Dear R Devel, > > Since Linux moved away from using a file-system interface for audio, I think it is necessary to write special libraries to interface with audio hardware from various languages on Linux. > > In R, it seems like the appropriate datatype for a `snd_pcm_t` handle pointing to an open ALSA source or sink would be a
2020 May 06
0
defining r audio connections
AFAIK that API is not allowed on CRAN. It triggers a NOTE or a WARNING, and your package will not be published. Gabor On Wed, May 6, 2020 at 9:04 PM Martin Morgan <mtmorgan.bioc at gmail.com> wrote: > > The public connection API is defined in > > https://github.com/wch/r-source/blob/trunk/src/include/R_ext/Connections.h > > I'm not sure of a good pedagogic example;
2020 May 06
2
defining r audio connections
The public connection API is defined in https://github.com/wch/r-source/blob/trunk/src/include/R_ext/Connections.h I'm not sure of a good pedagogic example; people who want to write their own connections usually want to do so for complicated reasons! This is my own abandoned attempt
2019 Dec 18
0
readBin should check that its endian argument is a legal value
Thank you for reporting this problem, R-devel now has a check in readBin and writeBin. I've identified two CRAN packages with an incorrect value for "endian" and reported to maintainers, unfortunately in their case the intention was to specify "little". Best Tomas On 11/18/19 11:22 PM, Jennifer Lyon wrote: > I think it would be helpful if readBin checked that its
2020 May 06
3
defining r audio connections
Dear R Devel, Since Linux moved away from using a file-system interface for audio, I think it is necessary to write special libraries to interface with audio hardware from various languages on Linux. In R, it seems like the appropriate datatype for a `snd_pcm_t` handle pointing to an open ALSA source or sink would be a "connection". Connection types are already defined in R for
2013 Dec 13
0
how to use the readBin ?
how to use the readBin ? i want to write the extended ascii character `Œ` into a file named c:/testbin, and read it in the R console ,display it as `Œ` in R console. now i can write it . zz <- file("c:/testbin", "wb") writeBin(charToRaw("\u0152"), zz) close(zz) when i open the file with office(encoding=utf-8),i can see `Œ`,whay i can not read it with readBin?
2005 Sep 18
0
Updated rawConnection() patch
Here's an update of my rawConnection() implementation. In addition to providing a raw version of textConnection(), this fixes two existing issues with textConnection(): one is that the current textConnection() implementation carries around unprotected SEXP pointers, the other is a performance problem due to prolific copying of the output buffer as output is accumulated line by line. This new
2023 Feb 15
1
Question on non-blocking socket
On 2/15/23 01:24, Ben Engbers wrote: > Hi, > > December 27, 2021 I started a thread asking for help troubleshooting > non-blocking sockets. > While developing the RBaseX client, I had issues with the > authentication process. It eventually turned out that a short break > had to be inserted in this process between sending the credentials to > the server and requesting
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi, I'm running into more issues when reading data from a gzfile connection. If I read the data sequentially with successive calls to readBin(), the data I get looks ok. But if I call seek() between the successive calls to readBin(), I get corrupted data. Here is a (hopefully) reproducible example. See my sessionInfo() at the end (I'm not on Windows, where, according to the man page,
2020 May 07
0
defining r audio connections
What's the gist of the problem of making/having this part of the public API? Is it security, is it stability, is it that the current API is under construction, is it a worry about maintenance load for R Core, ...? Do we know why? It sounds like it's a feature that is useful. I think we missed out on some great enhancements in the past because of it not being part of the public API.
2017 Oct 05
0
socketSelect(..., timeout): non-integer timeouts in (0, 2) (?) equal infinite timeout on Linux - weird
I'd like to follow up/bump the attention to this bug causing the timeout to fail for socketSelect() on Unix. It is still there in R 3.4.2 and R-devel. I've identified the bug in the R source code - the bug is due to floating-point precisions and comparison using >=. See PR17203 (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17203) for details and a patch. I've just
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"