#26 new
lyle (at lylejohnson)

addInput(socket, INPUT_READ) on WinXP

Reported by lyle (at lylejohnson) | November 11th, 2009 @ 10:29 PM

On Windows, when creating a TCPServer socket and calling addInput, i.e.

@srvSock = TCPServer.new("127.0.0.1", 7777)
addInput(srvSock, INPUT_READ, method(:gotCnx))

...

def gotCnx
    begin
      @socket = @srvSocket.accept_nonblock
    rescue Errno::EWOULDBLOCK
      puts "no call here?"
      @socket = nil
    end
end

the specified method (gotCnx) is called again and again, even if noone tries to make a connection (control flow enters rescue). On the net, I found something mentioning a mapping from fd to handle that is done by FXRuby, but maybe this doesn't work for sockets? (I found something about Windows sockets not having handles when not explicitly associated with one).

Comments and changes to this ticket

  • lyle (at lylejohnson)

    lyle (at lylejohnson) November 11th, 2009 @ 10:29 PM

    Lyle replied: I have the feeling this doesn't work for sockets (as you suspected). The way in which Ruby abstracts files and sockets as general-purpose I/O objects makes the mapping to FXRuby a little hairy, especially on Windows. I will look into this ASAP, but it will probably take me awhile to get a handle on it since I'm not a Windows programmer.

  • lyle (at lylejohnson)

    lyle (at lylejohnson) November 11th, 2009 @ 10:30 PM

    User Jim Hall added:

    I'm getting the same behavior on windows even when testing using a dummy IO object directly:

    dumsocket=IO.new(0,"r")
    @application.addInput(dumsocket,INPUT_READ,method(:packetInLoop))
    

    Wish I could help more. Unfortunately, I'm not a Windows coder myself either.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

FXRuby is a library for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for your Ruby applications. It’s based on the FOX Toolkit, a popular open source C++ library developed by Jeroen van der Zijp. What that means for you as an application developer is that you’re able to write code in the Ruby programming language that you already know and love, while at the same time taking advantage of the performance and functionality of a featureful, highly optimized C++ toolkit.

Shared Ticket Bins

People watching this ticket

Tags

Pages