> What a shame! It doesn't work on Windows. When comming to the > readpartial statement the program blocks. > Thank all very much for the time and effort to help me solving the > problem. Slowly I believe that windows is not able to do blocking > reading =( > > Have you got any further ideas? This does work on windows (it is a bit more code, see yourself): ---------------------------------------------------------- require 'socket' include Socket::Constants server = Socket.new(AF_INET, SOCK_STREAM, 0) rd, wr = nil, Socket.new(AF_INET, SOCK_STREAM, 0) server.bind(Socket.pack_sockaddr_in( 2200, 'localhost')) thread = Thread.new do server.listen(1) rd, addr = server.accept server.close end Thread.pass wr.connect(Socket.pack_sockaddr_in( 2200, 'localhost')) thread.join Thread.new { loop do puts rd.read(1) end } loop do sleep 1 wr.write "+" end ---------------------------------------------------------- (instead of Thread.pass you should do some real synchronisation) cheers Simon