Sunday 15 January 2012

Streaming socket service with EventMachine in Ruby not working -


I have the following event machine-based Ruby Client, but nothing is produced when connected to the server:

  Event Messine. Run Do conn = EventMachin :: HTTPEEET.net ('http: // localhost: 10000') http = conn.get http.stream do | Data | Data puts # It will have to install some intervals ("INT") {put 'IN'; Http.close; Event Markin. Stop} Trap ("TERM") {puts 'word'; Http.close; EventMachine.stop} and   

and service:

  module simulation class quoteService & lt; EM :: Connection def post_init says "Set up connection" # This output event mechanic. Ad_product_time (1) puts "test data" # this output sends (data "test data") end and event event.Choose signlat "INT") (Event MacInstop) SignalTrap ("TERM") {EventMachine.stop} Event Messine. Start_services ('0.0.0.0', 10000, Simulation :: Quotation service) End   

I think there is something wrong with the service Any ideas why the client does nothing?

Both your servers and customers work fine for example the customer google.com: Try connecting to 80 and you will see that it works.

Just for the server Telnet Localhost 10000 and you will also see here that the server will start printing test data .

But the problem is that your server is not compatible with your client. Your customer expects an HTTP server, but the server you are running is a simple EM :: connection that does not serve the HTTP client

So when the client connects, it expects a standard HTTP response, but whatever it is, the test data will never call the code stream of the code.

You need to either run an HTTP server, or EM :: connection instead of HttpRequest . To wit. The client and the server need to talk to the same protocol.

1 comment:

  1. Giuseppe: Streaming Socket Service With Eventmachine In Ruby Not Working - >>>>> Download Now

    >>>>> Download Full

    Giuseppe: Streaming Socket Service With Eventmachine In Ruby Not Working - >>>>> Download LINK

    >>>>> Download Now

    Giuseppe: Streaming Socket Service With Eventmachine In Ruby Not Working - >>>>> Download Full

    >>>>> Download LINK 7U

    ReplyDelete