HI All
I am newbie to using socket in R.
I wrote the function  below in R for Windows.
The strange behavior is that each time I call this function R seems to hang
for I don't know what reason.

If I give at prompt  line by line the commands below everything is fine:
connection happens immediately, and also reading data from the socket with
valid data.

If I pack these line into a function R starts freezing, connection doesn't
occurr immediately and so the following reading from the socket.

The very strange thing is that this weird behavior goes away once I remove
the read.socket calls. If there are not present; when I do this the
connection happens immediately, but with read.sockect everything hangs.

Can you help me?


        print ( "start" )
        aClient=make.socket( host="", 11111, fail=TRUE, server=FALSE )
        print( "connected" )
        data = read.socket( aClient, loop=FALSE )
        print ( "read" )
        print( data )

        data = read.socket( aClient, loop=FALSE )
        print ( "read" )
        print( data )
View this message in context: 
Sent from the R help mailing list archive at Nabble.com.

R-help@r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to