Re: backlog problem?



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:

> Hi,
>
> 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
> 5
> 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.connectToAddress(PlainSocketImpl.java:171)
> 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
> fail.
> However I run on Windows XP, it runs without any error.
>
> I have increased the ServerSocket backlog parameter on the server side
> to
> a bigger number (default is 50) but it makes no difference. Besides, I
> have modified /usr/include/linux/socket.h in which the constant
> SOMAXCONN
> 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
> which
> causes the program to throw exception when the clients connect faster
> than
> the server can accept.
>
> Any help is appreciated.
>
>
>
>
> __________________________________________
> Yahoo! DSL ?Something to write home about.
> Just $16.99/mo. or less.
> dsl.yahoo.com
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>




__________________________________________
Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • Re: Banana Republic (was Re: OpenVMS Book Wins award)
    ... client ... No bollocks HTTP, SOAP, XML, Java, Garbage ... receive messages from any number of server processes who in turn could be ... Unlike TCP/IP and/or UDP Sockets with Java that have been around since ...
    (comp.os.vms)
  • Re: Asynchronous socket programming vs. remoting
    ... You are the first person that said I should use sockets. ... them quicker than I can load them from my harddrive using the file system. ... It scales nice too - I tried throwing 400 requests at the server in a span ... > do not need the same assembly on the client and server. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Emulating I/O Completion Port on Win98.
    ... or for GUI programs - use async I/O ... > My Client is an FTP Client and I thought emulating IOCP would be the best ... > solution under Win98 to quickly copy a big file from the FTP Server. ... >>> monitor thread created dedicates to check the IO status of the sockets ...
    (microsoft.public.win32.programmer.networks)
  • Re: Emulating I/O Completion Port on Win98.
    ... server, not client? ... If you client behave as a server to other client you do can use IOCP too, ... > 1) How many sockets should be in the list? ...
    (microsoft.public.win32.programmer.networks)
  • Re: another sockets library
    ... Currently it is C, only, but platform independant (works on Windows, Mac ... There is a server and client example. ... I've seen this remark about Windows sockets and selecta few times ...
    (comp.lang.lisp)