Thanks Prof. If make.socket is not socket connection, then what is that?
What it is used for?

Any Idea ow to create string with embedded nulls.

Thanks,


On Wed, Jul 2, 2014 at 12:47 PM, Prof Brian Ripley <ripley@stats.ox.ac.uk>
wrote:

> On 01/07/2014 13:37, Param Jeet wrote:
>
>> I am trying to create socket connection in R.
>>
>
> That is not a 'socket connection'.  I suggest you use one instead: see
> ?socketConnection.
>
>
>>      socket <- make.socket("localhost",2099,T,T)
>>      msg2<-'function=subscribe|item=MI.EQCON.1|schema=last_price;ask;bid'
>>      write.socket(socket,msg2)
>>      read.socket(socket,252,FALSE)
>>
>> When I run the read.socket line, I get error:
>>
>>      Error in read.socket(socket, 252, FALSE) :
>>      embedded nul in string:
>> 'Ã¾Ã¾-\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\001\0\004\0CTCL\0\
>> 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
>>
>>
>> I am Unable to solve this problem. Please advice how to get rid of this
>> issue.
>>
>
> The help says
>
>      ‘read.socket’ reads a string from the specified socket,
>
> 'Strings' do not have embedded nulls: you need something which can do
> binary reads.  For that you need to use connections.
>
>
>>
>> Regards,
>>
>>         [[alternative HTML version deleted]]
>>
>>
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/
>> posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> --
> Brian D. Ripley,                  ripley@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>

	[[alternative HTML version deleted]]

