Re: backlog problem?
- From: Joanne Wing Yan Lai <joannelai@xxxxxxxxx>
- Date: Mon, 5 Dec 2005 23:12:34 -0800 (PST)
I even tested a similar program of Client Socket in C++ to connect to port
3306, but the exception "Could not bind to port." was caught after 5 or 6
sockets. So I am quite sure it's sth wrong with the OS (RedHat Linux).
--- Joanne Wing Yan Lai <joannelai@xxxxxxxxx> wrote:
> I have implemented a simple java application (J2SE 1.4.2) in which
> contains a server and a client.
> The server side has a ServerSocket to listen to the client messages and
> the client side has a for loop to create many socket to a specific port.
> When I run the client, the following stack trace was printed after 4 or
> sockets are created successfully.
> java.net.ConnectException: Connection refused
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
> at java.net.Socket.connect(Socket.java:426)
> at java.net.Socket.connect(Socket.java:376)
> at java.net.Socket.<init>(Socket.java:291)
> at java.net.Socket.<init>(Socket.java:119)
> at Client.main(Client.java:12)
> I have tested this on both RedHat linux 7.2 and RHEL 3.0 AS and both
> However I run on Windows XP, it runs without any error.
> I have increased the ServerSocket backlog parameter on the server side
> a bigger number (default is 50) but it makes no difference. Besides, I
> have modified /usr/include/linux/socket.h in which the constant
> is changed from 128 to 1024, but it doesn't help as well.
> It seems to be there's some controls or limitations in RedHat Linux
> causes the program to throw exception when the clients connect faster
> the server can accept.
> Any help is appreciated.
> Yahoo! DSL ?Something to write home about.
> Just $16.99/mo. or less.
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
redhat-list mailing list
- backlog problem?
- From: Joanne Wing Yan Lai
- backlog problem?