[R] read.socket utils package : something is going wrong

msalese massimo.salese at gmail.com
Wed Apr 4 14:49:01 CEST 2012


Found solution.
I've changed the library and functions to open and read sockets.

Using base package I wrote:

msg3<-"function=subscribe|item=MI.EQCON.1|schema=last_price;ask;bid"
msg4<-"function=unsubscribe"
#open socket connection
socketPointer<-socketConnection('localhost', port=5333, server=FALSE)
#subscribe
writeLines(msg3, socketPointer)
#read data from file
readLines(con=socketPointer,n=1,ok=TRUE,warn=TRUE,encoding='UTF-8')
#unsubscribe
writeLines(msg4, socketPointer)
#close socket
close(socketPointer)

Now it works fine.

--
View this message in context: http://r.789695.n4.nabble.com/read-socket-utils-package-something-is-going-wrong-tp4531374p4531764.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list