I've been using the (LLM generated) example below as a starting point for some basic web server scripts since last year. This worked fine on 3.3, but since upgrading to 3.4, I get RuntimeError as soon as a client connects.
server = TCPServer.new('0.0.0.0', 8080) loop do client = server.accept request = client.gets puts "Received request: #{request}" response = "HTTP/1.1 200 OK\r\n" \ "Content-Type: text/plain\r\n" \ "Content-Length: 13\r\n" \ "Connection: close\r\n" \ "\r\n" \ "Hello, world!" client.write(response) client.close end
With conf.enable_debug on current master:
mrbgems/mruby-socket/mrblib/socket.rb:285:in accept: RuntimeErrorAnd after removing the rescue block in TCPServer#accept:
mrbgems/mruby-socket/mrblib/socket.rb:257:in initialize: private method 'initialize' called for TCPSocket (NoMethodError)