# Strings from a Sockets Client

**URL:** <https://www.ruby-forum.com/t/strings-from-a-sockets-client/170384>\
**Category:** Rails\
**Created:** [June 16, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/strings-from-a-sockets-client/170384 "2009-06-16T21:57:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [June 16, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/strings-from-a-sockets-client/170384/1 "2009-06-16T21:57:27Z")

</div>

It seems Ruby Strings are a mess if you are trying to send them to a  
server listening on a given socket (that is not a ruby server. Say it  
is a Java server). Has anyone found a workaround for this?

I have a ruby client that must talk to a (running) Java process on the  
server – I cannot use JRuby on this one. Therefore, I am trying to  
communicate to it via a tcp sockets connection. I think what I need to  
do is likely convert the string to an array of integers representing  
the string (but even integers are objects in Ruby!). How can I  
communicate to a Java Sockets Server in Ruby? Thanks, Janna B
