title: send hex value to client side via ruby socket
body: <p>I am working on creating a socket server . This server is working on hex values.</p>
  
  <p>I am able to establish the connection to the server . But not able to read clients hex values and not able to put hex value to client side.</p>
  
  <pre><code>require "socket"
  
  
  def listenserver (server)
   @buff1 =[160, 124]
   client = server.accept
   puts  "#{client.inspect} is accepted"
   client.print "0x%02x" % @buff1[0]
   client.print"0x%02x" % @buff1[1]
   puts "#{@buff1.inspect}"
   puts "0x%02x" % @buff1[0]
   client.close
   puts "#{client} is gone"
  end
  
  server = TCPServer.new('x.x.x.x', 12345)
  loop do
   puts "Started TCPServer"
   listenserver(server)
  
  end
  </code></pre>