Forum: Ruby connection error in webrick server

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
38ddb944c57e439bd59b6d55eadbda56?d=identicon&s=25 cedric so (xedric)
on 2008-10-27 07:07
I did a simple server in ruby using webrick as shown in the
tutorial. My problem is that when I tested it with several
client connection, a number of connections were refused. I
can't find the reason why this happens, even though the default
maximum concurrent client is set to 100. I only made 50 concurrent
connections but more than 10 connections are often refused. Can
anyone explain the reason for this.

I also tried changing the default value to a higher value but to no
avail.

Thanks.
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-10-27 07:35
(Received via mailing list)
On 27.10.2008 07:06, Cedric Rosario wrote:
> I did a simple server in ruby using webrick as shown in the
> tutorial. My problem is that when I tested it with several
> client connection, a number of connections were refused. I
> can't find the reason why this happens, even though the default
> maximum concurrent client is set to 100. I only made 50 concurrent
> connections but more than 10 connections are often refused. Can
> anyone explain the reason for this.
>
> I also tried changing the default value to a higher value but to no
> avail.

What error message did you see?  Are there firewalls in between?  Did
you use hostname for the server URL and can this name be resolved on all
hosts? ...

Kind regards

  robert
38ddb944c57e439bd59b6d55eadbda56?d=identicon&s=25 cedric so (xedric)
on 2008-10-27 08:02
Robert Klemme wrote:
>
> What error message did you see?  Are there firewalls in between?  Did
> you use hostname for the server URL and can this name be resolved on all
> hosts? ...
>
> Kind regards
>
>   robert

This was the error message..
Errno::ECONNREFUSED: Connection refused - "connect(2)"

There are no firewalls set, and I am only using a single computer for
this.
I used the ip address instead of the hostname.

Thanks.

cedric
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-10-27 09:26
(Received via mailing list)
2008/10/27 cedric so <xeddr@yahoo.com>:
> This was the error message..
> Errno::ECONNREFUSED: Connection refused - "connect(2)"
>
> There are no firewalls set, and I am only using a single computer for
> this.
> I used the ip address instead of the hostname.

Hm...  Is the hosting system a Windows non server version?  That could
play a role as well.  Or, your Webrick dies for some reason and hence
you cannot connect any more.  There are so many options where network
communication can go wrong...

Cheers

robert
38ddb944c57e439bd59b6d55eadbda56?d=identicon&s=25 cedric so (xedric)
on 2008-10-27 23:23
Robert Klemme wrote:
>
> Hm...  Is the hosting system a Windows non server version?  That could
> play a role as well.  Or, your Webrick dies for some reason and hence
> you cannot connect any more.  There are so many options where network
> communication can go wrong...
>
> Cheers
>
> robert

I tested it both on a Windows non-server and server versions but the
results
were the same. The Webrick does not die because it still accepts
connections
whenever I run the my test program. My only problem is that it doesn't
accept
all the connections.

Thanks.

cedric
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (Guest)
on 2008-10-28 07:40
(Received via mailing list)
On 27.10.2008 23:22, cedric so wrote:
> whenever I run the my test program. My only problem is that it doesn't
> accept
> all the connections.

Did you check connection state with netstat?  It may be that socket
resources are not released fast enough.  I'm not a network admin but it
may be that you can remedy this with a changed timeout setting.

Kind regards

  robert
This topic is locked and can not be replied to.