Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

addInput(socket, INPUT_READ) on WinXP

#26

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).

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

State: new
Milestone: none
Assigned to: lyle (at lylejohnson) lyle (at lylejohnson)

Activity

  1. lyle (at lylejohnson)
    lyle (at lylejohnson)

    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.

    November 11th, 2009 @ 10:29 PM

  2. lyle (at lylejohnson)
    lyle (at lylejohnson)

    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.

    November 11th, 2009 @ 10:30 PM

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.