Skip to content

Infinite loop if the connection is lost #27

@mame

Description

@mame

while !@closed do
begin
unless recv_data = @socket.getc
sleep 1
next
end

When the TCPSocket is closed from the server side, getc always returns nil, so this code is an infinite loop. I am not sure what the intent of this code is, but it is definitely a bug and I am reporting it anyway.

Note that reading one letter at a time by using getc is not a good idea in terms of efficiency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions