Method: StreamTest#setup
- Defined in:
- lib/vendor/xmpp4r/test/tc_stream.rb
#setup ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vendor/xmpp4r/test/tc_stream.rb', line 15 def setup @tmpfile = Tempfile.new("StreamSendTest") @tmpfilepath = @tmpfile.path() @tmpfile.unlink @servlisten = UNIXServer.new(@tmpfilepath) thServer = Thread.new { @server = @servlisten.accept } @iostream = UNIXSocket.new(@tmpfilepath) n = 0 while not defined? @server and n < 10 sleep 0.1 n += 1 end @stream = Stream.new @stream.start(@iostream) end |