Changeset 197

Show
Ignore:
Timestamp:
06/03/06 20:06:56 (2 years ago)
Author:
blackhedd
Message:

client tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • experiments/NewMachine/test/event1_test.rb

    r191 r197  
    6464 
    6565    def string_event evt 
    66       p @@previous.length 
     66      #p @@previous.length 
    6767      if @@previous.length > 1 
    6868        @@previous[-2].send_event "a" 
  • experiments/NewMachine/test/tcp_test.rb

    r193 r197  
    1414  end 
    1515  def received_line ln 
     16    Machine::Reactor.stop if ln == "STOP" 
     17  end 
     18end 
     19 
     20class LineProtocol2 < Machine::LineReceiver 
     21  def initialize 
     22    super 
     23  end 
     24  def completed_connection evt 
     25    p "Got connection" 
     26  end 
     27  def received_line ln 
     28    p ln 
    1629    Machine::Reactor.stop if ln == "STOP" 
    1730  end 
     
    3750  end 
    3851 
     52  def test_tcp_client 
     53    Reactor.run { 
     54      Reactor.connect_tcp "relay.spheriq.net", 25, LineProtocol2.new 
     55    } 
     56  end 
     57 
    3958end