Sha256: 8f55a361026a1ec0758f0acf84b0501b99d884d8c7f3c99cabf40ec3d5f94ae0

Contents?: true

Size: 439 Bytes

Versions: 6

Compression:

Stored size: 439 Bytes

Contents

require 'socket'
require "uri"

module GameMachine
  module Clients
    class TcpClient

      def initialize(host,port)
        @host = host
        @port = port
        @socket = TCPSocket.open(@host,@port)
      end

      def send_message(message)
        @socket.send(message,0)
        #@socket.send(String.from_java_bytes(message))
      end

      def receive_message
        @socket.recvfrom(1024)[0]
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
game_machine-1.0.4 lib/game_machine/clients/tcp_client.rb
game_machine-1.0.2 lib/game_machine/clients/tcp_client.rb
game_machine-0.0.11 lib/game_machine/clients/tcp_client.rb
game_machine-0.0.10 lib/game_machine/clients/tcp_client.rb
game_machine-0.0.9 lib/game_machine/clients/tcp_client.rb
game_machine-0.0.8 lib/game_machine/clients/tcp_client.rb