Unix domain socket connection limits ?

Hi All,
I'm trying to handle more than 32 conn. connections on a unix socket domain on Solaris 8 or 7. I couldn't able to pass 32 connection limit. As far as I know, this was a limit for Solaris 2.5.1 or 2.6. I raised the tcp_conn_req_maxq and tcp_conn_req_maxq0 values to greater than 1024 and it didn't help out.
Is there anyone who knows how to pass this limit ?
Best Regards,
P.S. I have 1GB ram on each machine.

The default limit is 256. Try to look plimit command, which change thats limits.

Similar Messages

  • Client connection using UNIX Domain Socket

    Hello all,
    I am getting the following error when I try to connect from a 32-bit TimesTen client to the 64-bit TimesTen data manager via UNIX domain socket.
    NOTE: I can make SHM connections from 32-bit client to 64-bit server though.
    # ttisqlcs test_uds
    Copyright (c) 1996-2007, Oracle. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
    All commands must end with a semicolon character.
    connect "DSN=test_uds";
    08001: Unable to connect to data source (DSN: test_uds; Network Address: ttLocalHost; Port Number: 18003). Please refer to TimesTen Server log to see if connection over UNIX domain socket is allowed at this point in time
    The command failed.
    Done.
    Both 32-bit client and 64-bit server processes run on the same box. I do not see any errors in the user or server log files.
    Entry in sys.ttconnect.ini file
    [ttLocalHost-tt_704_dev]
    Description=TimesTen Server
    Network_Address=ttLocalHost
    TCP_PORT=18003
    Entry in sys.odbc.ini file
    [test_uds]
    Driver=/ttsoft/TimesTen32/TimesTen/tt70_32/lib/libttclient.so
    TTC_SERVER=ttLocalHost-tt_704_dev
    TTC_SERVER_DSN=test
    Thanks,
    Senthil.

    Could this be bug 4950822? This was documented in the 6.0.3 Release Notes "Known Limitations" section:
    "On Unix, when using ttlocalhost, a client of one TimesTen instance cannot connect with a server of another TimesTen instance. The workaround is to use ttShmHost (shared memory IPC) or localhost (127.0.0.1)."
    The error message received matches the one you're seeing.

  • Unix Domain Socket - Question about work around

    Since Unix Domain Sockets are platform dependent and Java is platform independent, it does not support it.
    However, I am sure some of you have worked with them and found some good work around.
    Elsewhere Jtux was suggested as a possible fix. However, I have not seen any good testimonials to it working. Also, if there are any security issues with this software. The website is here: http://www.basepath.com/aup/jtux/
    Does anyone have any other suggest?
    Thanks.

    I am modifying a current app. I must use the Unix
    Domain Sockets. I have no choice in the matters. It's
    for security reasons that they must be left in place.I can only guess that you do not understand my suggestion.
    The proxy does a domain socket to regular socket - just a pass through. You write this in C/C++.
    In your java app, as one option, you use Runtime.exec() to start the proxy. Then you use a java socket to connect to it. You can pass options to the proxy to control the socket behavior on both ends.
    In terms of usage there are a number of variations on the above.

  • Unix Domain socket, ECONNREFUSED causes?

    I would like to have a complete list of possible causes for connect(3SOCKET) to return ECONNREFUSED. I have a pthreads application that fails a test case due to connection refused, and none of the usual causes seem to make sense.
    - socket path exists but nobody is listening on the socket - pfiles shows that the server side has the socket descriptor open
    - too many connections - pfiles and lsof show that this is not the case - very few connections open
    - wrong type of socket? debugger shows this is not the case
    - wrong file permissions on socket? ls shows that this is not the case
    What other causes for ECONNREFUSED could there be?
    thanks
    --donb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Yes what does the term "Unix Domain Socket" refer to.
    I can think of several possibilities....
    1. It just means "socket". So you use the socket stuff.
    2. It is port specific/ip range specific, so you use the port/ip with the regular socket stuff.
    3. It is a layer in regular TCP/IP (like VPNs) so unless the layer itself is being managed a java app doesn't need to do anything.
    4. It is a different protocol (or with extended features) from a regular TCP socket. In that case you would have to write your own socket layer via JNI to handle it.

  • Unix Domain Socket

    Hi,
    How can Java connect to a Unix Domain Socket?
    Help please!

    Yes what does the term "Unix Domain Socket" refer to.
    I can think of several possibilities....
    1. It just means "socket". So you use the socket stuff.
    2. It is port specific/ip range specific, so you use the port/ip with the regular socket stuff.
    3. It is a layer in regular TCP/IP (like VPNs) so unless the layer itself is being managed a java app doesn't need to do anything.
    4. It is a different protocol (or with extended features) from a regular TCP socket. In that case you would have to write your own socket layer via JNI to handle it.

  • Open unix domain socket (Linux)

    How do I open a unix domain socket under linux using Labview (7.1).
    I would like to write messages to /dev/log.
    thanx
    Message Edited by Dennisvr on 01-27-2006 04:20 AM

    Dennisvr wrote:
    Pipes and sockets are
    different things. At first I thougt they could be the same too, and I
    even tried opening it using the LabVIEW pipe functions, but that didn't
    work.   Look at this link, it explains how it works, even with some examples: http://www.ecst.csuchico.edu/~beej/guide/ipc/usock​.html
    I
    see. Well LabVIEW does not support this type of socket. The only socket
    interface it has already is the one used for its TCP/UDP implementation
    and that is using sockaddr_in internally to bind. As such you have two
    options:
    1) Write your own domain socket interface writing a shared library and the according interface VIs.
    2) Or use TCP/IP interprocess communication instead.
    In terms of functionality TCP/IP will be the same as what you could
    possibly get from domain sockets. The only reason to use domain sockets
    instead of TCP/IP sockets might be that domain sockets have a
    more  optimized data transfer since they do not take precautions
    for remote data transfer. If you really need this (possible?) increased
    performance you will have to do some work.
    However domain sockets seem little known and might be a new technology.
    So I would make sure it is properly supported on all the potential
    system you try to use this before taking the plunge to write your own
    shared library interface to call through the Call Library Node.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Unix domain sockets: How to name them? And where to put them?

    I am using unix sockets for inter-process communication in a C++/gtkmm project.
    Are there naming conventions and conventions about where to place sockets in the filesystem? In all example code I found, dummies like /home/user/mysocket were being used.
    If there are not any conventions: Would it be sensible to put the sockets in /tmp/ and compose the names of the name of the program which uses the concerning socket, and its PID? (The latter also depends on my use case, of course; from that point of view, it seems sensible.)

    @Franek:  KDE applications place their sockets (through KDE API, of course) in "/tmp/ksocket-foo/bar__0", where "foo" is the user name, "bar" the application name and "0" an increasing counter (in case an application creates more than one socket).  Emacs places its server socket in a similar manner "/tmp/emacs1000/server", where "1000" is the UID.
    I'd use emacs' name scheme, e.g. "/tmp/bar1000/what_the_socket_is_for", where "bar" is the application name again. 
    However, do not place sockets directly in "/tmp/". For one thing, it just clutters this global directory, but more importantly it's unsafe, as every other user can inspect these sockets.  Create a directory within "/tmp/" and restrict its access rights to the owner (mode 700).  Thus other users can't inspect the sockets within that directory.  Of course, the access rights of the sockets themselves must also be limited.
    Last edited by lunar (2011-10-12 18:59:32)

  • I am having problems with a clean install of the system Lion os over the internet Do these readings off socket connections look correct?

    Active Internet connections
    Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)   
    tcp4       0      0  10.0.0.2.50921         a184-25-165-54.d.https CLOSE_WAIT
    tcp4       0      0  10.0.0.2.50920         a184-25-165-54.d.https CLOSE_WAIT
    tcp6       0      0  localhost.50866                               localhost.krb524                              CLOSE_WAIT
    tcp6       0      0  localhost.50865                               localhost.krb524                              CLOSE_WAIT
    tcp6       0      0  localhost.50573                               localhost.krb524                              CLOSE_WAIT
    tcp6       0      0  localhost.50572                               localhost.krb524                              CLOSE_WAIT
    tcp4     212      0  10.0.0.2.50258         ip171.67-202-66..http  CLOSE_WAIT
    tcp6       0      0  localhost.50040                               localhost.krb524                              CLOSE_WAIT
    tcp6       0      0  localhost.50039                               localhost.krb524                              CLOSE_WAIT
    tcp4       0      0  10.0.0.2.49771         l3.ycs.vip.dxs.y.http  CLOSE_WAIT
    tcp4       0      0  10.0.0.2.49770         l3.ycs.vip.dxs.y.http  CLOSE_WAIT
    tcp4       0      0  10.0.0.2.49769         l3.ycs.vip.dxs.y.http  CLOSE_WAIT
    tcp4       0      0  10.0.0.2.49768         l3.ycs.vip.dxs.y.http  CLOSE_WAIT
    tcp4     414      0  10.0.0.2.49743         a209-8-118-73.de.http  CLOSE_WAIT
    tcp4     414      0  10.0.0.2.49742         a209-8-118-73.de.http  CLOSE_WAIT
    tcp6       0      0  localhost.49590                               localhost.krb524                              CLOSE_WAIT
    tcp6       0      0  localhost.49589                               localhost.krb524                              CLOSE_WAIT
    tcp4      60      0  localhost.49553        localhost.10025        CLOSE_WAIT
    tcp4       0      0  localhost.5348         localhost.49188        ESTABLISHED
    tcp4       0      0  localhost.49188        localhost.5348         ESTABLISHED
    tcp6       0      0  localhost.49187                               localhost.krb524                              CLOSE_WAIT
    tcp4       0      0  localhost.5348         localhost.49185        ESTABLISHED
    tcp4       0      0  localhost.49185        localhost.5348         ESTABLISHED
    tcp6       0      0  localhost.49182                               localhost.krb524                              CLOSE_WAIT
    tcp4       0      0  localhost.5348         localhost.49171        ESTABLISHED
    tcp4       0      0  localhost.49171        localhost.5348         ESTABLISHED
    tcp4       0      0  localhost.5348         localhost.49170        ESTABLISHED
    tcp4       0      0  localhost.49170        localhost.5348         ESTABLISHED
    tcp4       0      0  localhost.5348         localhost.49169        ESTABLISHED
    tcp4       0      0  localhost.49169        localhost.5348         ESTABLISHED
    udp4       0      0  *.*                    *.*                              
    udp4       0      0  *.net-assistant        *.*                              
    udp4       0      0  *.*                    *.*                              
    udp6       0      0  *.64380                                       *.*                                                     
    udp4       0      0  *.64380                *.*                              
    udp6       0      0  *.51586                                       *.*                                                     
    udp4       0      0  *.51586                *.*                              
    udp6       0      0  *.62455                                       *.*                                                     
    udp4       0      0  *.62455                *.*                              
    udp6       0      0  *.59243                                       *.*                                                     
    udp4       0      0  *.59243                *.*                              
    udp6       0      0  *.52328                                       *.*                                                     
    udp4       0      0  *.52328                *.*                              
    udp4       0      0  *.apple-sasl           *.*                              
    udp4       0      0  *.snmp                 *.*                              
    udp4       0      0  10.0.0.2.ntp           *.*                              
    udp6       0      0  judicialethic.ntp                             *.*                                                     
    udp6       0      0  localhost.ntp                                 *.*                                                     
    udp4       0      0  localhost.ntp          *.*                              
    udp6       0      0  localhost.ntp                                 *.*                                                     
    udp6       0      0  *.ntp                                         *.*                                                     
    udp4       0      0  *.ntp                  *.*                              
    udp4       0      0  *.kerberos             *.*                              
    udp6       0      0  *.kerberos                                    *.*                                                     
    udp4       0      0  *.54974                *.*                              
    udp4       0      0  *.54226                *.*                              
    udp4       0      0  *.*                    *.*                              
    udp6       0      0  localhost.ipsec-ms                            *.*                                                     
    udp6       0      0  localhost.isakmp                              *.*                                                     
    udp4       0      0  localhost.ipsec-msft   *.*                              
    udp4       0      0  localhost.isakmp       *.*                              
    udp6       0      0  localhost.ipsec-ms                            *.*                                                     
    udp6       0      0  localhost.isakmp                              *.*                                                     
    udp6       0      0  judicialethic.ipsec-ms                        *.*                                                     
    udp6       0      0  judicialethic.isakmp                          *.*                                                     
    udp4       0      0  10.0.0.2.ipsec-msft    *.*                              
    udp4       0      0  10.0.0.2.isakmp        *.*                              
    udp4       0      0  *.l2f                  *.*                              
    udp6       0      0  localhost.63635                               localhost.63635                                         
    udp4       0      0  *.kpasswd              *.*                              
    udp6       0      0  *.kpasswd                                     *.*                                                     
    udp6       0      0  *.mdns                                        *.*                                                     
    udp4       0      0  *.mdns                 *.*                              
    udp4       0      0  *.*                    *.*                              
    udp4       0      0  *.*                    *.*                              
    udp4       0      0  *.*                    *.*                              
    udp4       0      0  *.*                    *.*                              
    udp46      0      0  *.*                    *.*                              
    udp4       0      0  *.netbios-dgm          *.*                              
    udp4       0      0  *.netbios-ns           *.*                              
    udp4       0      0  localhost.60762        *.*                              
    icm4       0      0  *.*                    *.*                              
    icm6       0      0  *.*                                           *.*                                                     
    Active LOCAL (UNIX) domain sockets
    Address          Type   Recv-Q Send-Q            Inode             Conn             Refs          Nextref Addr
    ffffff800ce4dd48 stream      0      0                0 ffffff800fc65af0                0                0 /var/run/mDNSResponder
    ffffff800fc65af0 stream      0      0                0 ffffff800ce4dd48                0                0
    ffffff800de1d968 stream      0      0                0 ffffff801078a900                0                0 /var/run/mDNSResponder
    ffffff801078a900 stream      0      0                0 ffffff800de1d968                0                0
    ffffff800cd89960 stream      0      0                0 ffffff800cd89a28                0                0
    ffffff800cd89a28 stream      0      0                0 ffffff800cd89960                0                0
    ffffff800cf100c8 stream      0      0                0 ffffff800fc66c20                0                0
    ffffff800fc66c20 stream      0      0                0 ffffff800cf100c8                0                0
    ffffff800cbd6ee0 stream      0      0                0 ffffff801078a388                0                0
    ffffff801078a388 stream      0      0                0 ffffff800cbd6ee0                0                0
    ffffff800ce4fe18 stream      0      0                0 ffffff800e9f3258                0                0
    ffffff800e9f3258 stream      0      0                0 ffffff800ce4fe18                0                0
    ffffff800ce4d4b0 stream      0      0                0 ffffff800e9f46a8                0                0
    ffffff800e9f46a8 stream      0      0                0 ffffff800ce4d4b0                0                0
    ffffff800fc65708 stream      0      0                0 ffffff800cd8a130                0                0 /var/run/caldavd/caldavd.sock
    ffffff800cd8a130 stream      0      0                0 ffffff800fc65708                0                0
    ffffff80107894b0 stream      0      0                0 ffffff800de1de18                0                0 /var/run/caldavd/caldavd.sock
    ffffff800de1de18 stream      0      0                0 ffffff80107894b0                0                0
    ffffff801078af40 stream      0      0                0 ffffff800e9f4ce8                0                0 /var/run/caldavd/caldavd.sock
    ffffff800e9f50d0 stream      0      0                0 ffffff800e9f5008                0                0 /var/run/caldavd/caldavd.sock
    ffffff800e9f5008 stream      0      0                0 ffffff800e9f50d0                0                0
    ffffff800e9f4ce8 stream      0      0                0 ffffff801078af40                0                0
    ffffff800e9f3320 stream      0      0                0 ffffff8010789640                0                0 /var/run/mDNSResponder
    ffffff8010789640 stream      0      0                0 ffffff800e9f3320                0                0
    ffffff801078bd50 stream      0      0                0 ffffff8010789960                0                0 /var/run/mDNSResponder
    ffffff8010789960 stream      0      0                0 ffffff801078bd50                0                0
    ffffff800e9f4900 stream      0      0                0 ffffff800e9f3a28                0                0 /var/run/mDNSResponder
    ffffff800e9f3a28 stream      0      0                0 ffffff800e9f4900                0                0
    ffffff800fc67580 stream      0      0                0 ffffff800fc66130                0                0 /var/run/mDNSResponder
    ffffff800fc66130 stream      0      0                0 ffffff800fc67580                0                0
    ffffff800fc661f8 stream      0      0                0 ffffff800cbd6a30                0                0 /var/run/mDNSResponder
    ffffff800cbd6a30 stream      0      0                0 ffffff800fc661f8                0                0
    ffffff800fc67c88 stream      0      0                0 ffffff800fc66900                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800fc66900 stream      0      0                0 ffffff800fc67c88                0                0
    ffffff800fc67008 stream      0      0 ffffff8010af64d8                0                0                0 /var/run/caldavd/caldavd-stats.sock
    ffffff800de1dd50 stream      0      0 ffffff8010b11550                0                0                0 /var/run/caldavd/caldavd.sock
    ffffff801078b7d8 stream      0      0                0 ffffff800fc66b58                0                0 /var/run/mDNSResponder
    ffffff800fc66b58 stream      0      0                0 ffffff801078b7d8                0                0
    ffffff800de1dc88 stream      0      0                0 ffffff800fc66e78                0                0 /var/run/mDNSResponder
    ffffff800fc66e78 stream      0      0                0 ffffff800de1dc88                0                0
    ffffff800cbd4ed8 stream      0      0                0 ffffff800cbd4320                0                0
    ffffff800cbd4320 stream      0      0                0 ffffff800cbd4ed8                0                0
    ffffff800cbd4258 stream      0      0                0 ffffff800cbd44b0                0                0
    ffffff800cbd44b0 stream      0      0                0 ffffff800cbd4258                0                0
    ffffff800cbd4190 stream      0      0                0 ffffff800cd8b648                0                0
    ffffff800cd8b648 stream      0      0                0 ffffff800cbd4190                0                0
    ffffff800cd8b198 stream      0      0                0 ffffff800cd8ae78                0                0
    ffffff800cd8ae78 stream      0      0                0 ffffff800cd8b198                0                0
    ffffff800cd8ace8 stream      0      0                0 ffffff800cd8a9c8                0                0
    ffffff800cd8a9c8 stream      0      0                0 ffffff800cd8ace8                0                0
    ffffff800cd8a388 stream      0      0                0 ffffff800cd8a1f8                0                0
    ffffff800cd8a1f8 stream      0      0                0 ffffff800cd8a388                0                0
    ffffff800cd8a068 stream      0      0                0 ffffff800cd89d48                0                0
    ffffff800cd89d48 stream      0      0                0 ffffff800cd8a068                0                0
    ffffff800cd89bb8 stream      0      0                0 ffffff800cd89898                0                0
    ffffff800cd89898 stream      0      0                0 ffffff800cd89bb8                0                0
    ffffff800cd893e8 stream      0      0                0 ffffff800cd89708                0                0
    ffffff800cd89708 stream      0      0                0 ffffff800cd893e8                0                0
    ffffff800ce4fd50 stream      0      0                0 ffffff800ce4fbc0                0                0
    ffffff800ce4fbc0 stream      0      0                0 ffffff800ce4fd50                0                0
    ffffff800ce4f8a0 stream      0      0                0 ffffff800ce4f260                0                0
    ffffff800ce4f260 stream      0      0                0 ffffff800ce4f8a0                0                0
    ffffff800ce4f0d0 stream      0      0                0 ffffff800ce4ef40                0                0
    ffffff800ce4ef40 stream      0      0                0 ffffff800ce4f0d0                0                0
    ffffff800ce4e900 stream      0      0                0 ffffff800ce4e5e0                0                0
    ffffff800ce4e5e0 stream      0      0                0 ffffff800ce4e900                0                0
    ffffff800ce4e2c0 stream      0      0                0 ffffff800ce4e450                0                0
    ffffff800ce4e450 stream      0      0                0 ffffff800ce4e2c0                0                0
    ffffff800ce4ea90 stream      0      0                0 ffffff800ce4dc80                0                0
    ffffff800ce4dc80 stream      0      0                0 ffffff800ce4ea90                0                0
    ffffff800ce4d7d0 stream      0      0                0 ffffff800ce4d960                0                0
    ffffff800ce4d960 stream      0      0                0 ffffff800ce4d7d0                0                0
    ffffff800e9f45e0 stream      0      0                0 ffffff800ce4d320                0                0
    ffffff800ce4d320 stream      0      0                0 ffffff800e9f45e0                0                0
    ffffff800ce4d190 stream      0      0                0 ffffff800ce4d000                0                0
    ffffff800ce4d000 stream      0      0                0 ffffff800ce4d190                0                0
    ffffff800cf127d8 stream      0      0                0 ffffff800cf12710                0                0
    ffffff800cf12710 stream      0      0                0 ffffff800cf127d8                0                0
    ffffff800cd8adb0 stream      0      0                0 ffffff800cd8a900                0                0
    ffffff800cd8a900 stream      0      0                0 ffffff800cd8adb0                0                0
    ffffff800cd89e10 stream      0      0                0 ffffff800cd8ac20                0                0
    ffffff800cd8ac20 stream      0      0                0 ffffff800cd89e10                0                0
    ffffff800ce4f328 stream      0      0                0 ffffff800ce4ded8                0                0
    ffffff800ce4ded8 stream      0      0                0 ffffff800ce4f328                0                0
    ffffff800ce4e9c8 stream      0      0                0 ffffff800ce4d898                0                0
    ffffff800ce4d898 stream      0      0                0 ffffff800ce4e9c8                0                0
    ffffff800cf12580 stream      0      0                0 ffffff800cd89000                0                0
    ffffff800cd89000 stream      0      0                0 ffffff800cf12580                0                0
    ffffff800cd89af0 stream      0      0                0 ffffff800cbd4d48                0                0
    ffffff800cbd4d48 stream      0      0                0 ffffff800cd89af0                0                0
    ffffff800cbd51f8 stream      0      0                0 ffffff800ce4f7d8                0                0
    ffffff800ce4f7d8 stream      0      0                0 ffffff800cbd51f8                0                0
    ffffff801078bc88 stream      0      0                0 ffffff800cf12a30                0                0
    ffffff800cf12a30 stream      0      0                0 ffffff801078bc88                0                0
    ffffff800cbd40c8 stream      0      0                0 ffffff800cbd43e8                0                0
    ffffff800cbd43e8 stream      0      0                0 ffffff800cbd40c8                0                0
    ffffff800cbd4a28 stream      0      0                0 ffffff800ce4d0c8                0                0
    ffffff800ce4d0c8 stream      0      0                0 ffffff800cbd4a28                0                0
    ffffff800cd8b580 stream      0      0                0 ffffff800cbd4708                0                0
    ffffff800cbd4708 stream      0      0                0 ffffff800cd8b580                0                0
    ffffff800cd89fa0 stream      0      0                0 ffffff800ce4f4b8                0                0
    ffffff800ce4f4b8 stream      0      0                0 ffffff800cd89fa0                0                0
    ffffff800cbd4578 stream      0      0                0 ffffff800cd8b8a0                0                0
    ffffff800cd8b8a0 stream      0      0                0 ffffff800cbd4578                0                0
    ffffff800ce4d708 stream      0      0                0 ffffff800cd89320                0                0
    ffffff800cd89320 stream      0      0                0 ffffff800ce4d708                0                0
    ffffff801078a518 stream      0      0                0 ffffff801078a1f8                0                0
    ffffff801078a1f8 stream      0      0                0 ffffff801078a518                0                0
    ffffff8010789320 stream      0      0                0 ffffff8010789a28                0                0
    ffffff8010789a28 stream      0      0                0 ffffff8010789320                0                0
    ffffff800fc66068 stream      0      0                0 ffffff800e9f5580                0                0 /var/run/mDNSResponder
    ffffff800e9f5580 stream      0      0                0 ffffff800fc66068                0                0
    ffffff800ce4e130 stream      0      0                0 ffffff8010789ed8                0                0
    ffffff8010789ed8 stream      0      0                0 ffffff800ce4e130                0                0
    ffffff800cf10000 stream      0      0 ffffff801548d930                0                0                0 /tmp/launchd-1865.gqpjxp/sock
    ffffff800e9f33e8 stream      0      0                0 ffffff800e9f34b0                0                0 /var/run/mDNSResponder
    ffffff800e9f34b0 stream      0      0                0 ffffff800e9f33e8                0                0
    ffffff801078b260 stream      0      0                0 ffffff801078ba30                0                0
    ffffff801078ba30 stream      0      0                0 ffffff801078b260                0                0
    ffffff800e9f5ee0 stream      0      0                0 ffffff800fc67198                0                0 /var/run/mDNSResponder
    ffffff800fc67198 stream      0      0                0 ffffff800e9f5ee0                0                0
    ffffff80107890c8 stream      0      0                0 ffffff800de1dbc0                0                0
    ffffff800de1dbc0 stream      0      0                0 ffffff80107890c8                0                0
    ffffff801078b710 stream      0      0                0 ffffff800fc674b8                0                0
    ffffff800fc674b8 stream      0      0                0 ffffff801078b710                0                0
    ffffff800ce4e388 stream      0      0                0 ffffff800fc67328                0                0 /var/run/mDNSResponder
    ffffff800fc67328 stream      0      0                0 ffffff800ce4e388                0                0
    ffffff801078bbc0 stream      0      0                0 ffffff801078a5e0                0                0 /var/run/mDNSResponder
    ffffff801078a5e0 stream      0      0                0 ffffff801078bbc0                0                0
    ffffff801078ae78 stream      0      0                0 ffffff801078a068                0                0
    ffffff801078a068 stream      0      0                0 ffffff801078ae78                0                0
    ffffff800ce4e068 stream      0      0                0 ffffff801078a130                0                0
    ffffff801078a130 stream      0      0                0 ffffff800ce4e068                0                0
    ffffff8010789bb8 stream      0      0                0 ffffff8010789c80                0                0 /var/run/mDNSResponder
    ffffff8010789c80 stream      0      0                0 ffffff8010789bb8                0                0
    ffffff8010789d48 stream      0      0                0 ffffff801078baf8                0                0 /var/run/mDNSResponder
    ffffff801078baf8 stream      0      0                0 ffffff8010789d48                0                0
    ffffff801078b198 stream      0      0                0 ffffff800be6e648                0                0 /var/run/mDNSResponder
    ffffff801078b8a0 stream      0      0                0 ffffff801078b968                0                0 /var/run/mDNSResponder
    ffffff800be6e648 stream      0      0                0 ffffff801078b198                0                0
    ffffff801078b968 stream      0      0                0 ffffff801078b8a0                0                0
    ffffff800be6c0c8 stream      0      0                0 ffffff801078b580                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff801078b580 stream      0      0                0 ffffff800be6c0c8                0                0
    ffffff800e9f49c8 stream      0      0                0 ffffff800e9f4838                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800e9f4838 stream      0      0                0 ffffff800e9f49c8                0                0
    ffffff800e9f42c0 stream      0      0                0 ffffff800e9f4388                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800e9f4388 stream      0      0                0 ffffff800e9f42c0                0                0
    ffffff800e9f41f8 stream      0      0                0 ffffff800e9f4130                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800e9f4130 stream      0      0                0 ffffff800e9f41f8                0                0
    ffffff800be6e710 stream      0      0                0 ffffff800fc67260                0                0 /var/run/mDNSResponder
    ffffff800fc67260 stream      0      0                0 ffffff800be6e710                0                0
    ffffff800fc65190 stream      0      0                0 ffffff801078b008                0                0 /var/run/mDNSResponder
    ffffff801078b008 stream      0      0                0 ffffff800fc65190                0                0
    ffffff800fc65960 stream      0      0                0 ffffff800fc65898                0                0
    ffffff800fc65898 stream      0      0                0 ffffff800fc65960                0                0
    ffffff801078b0d0 stream      0      0 ffffff80112a3d10                0                0                0 /var/folders/km/pqn45k251bb1pqsswl5ns_gw0000gn/T/icssuis501
    ffffff801078b328 stream      0      0                0 ffffff801078ab58                0                0
    ffffff801078ab58 stream      0      0                0 ffffff801078b328                0                0
    ffffff801078adb0 stream      0      0                0 ffffff800fc650c8                0                0 /var/run/mDNSResponder
    ffffff800fc650c8 stream      0      0                0 ffffff801078adb0                0                0
    ffffff801078aa90 stream      0      0                0 ffffff8010789fa0                0                0 /var/run/mDNSResponder
    ffffff8010789fa0 stream      0      0                0 ffffff801078aa90                0                0
    ffffff801078a770 stream      0      0                0 ffffff801078a838                0                0 /var/run/mDNSResponder
    ffffff801078a838 stream      0      0                0 ffffff801078a770                0                0
    ffffff801078ac20 stream      0      0                0 ffffff801078ace8                0                0
    ffffff801078ace8 stream      0      0                0 ffffff801078ac20                0                0
    ffffff801078b3f0 stream      0      0                0 ffffff801078b4b8                0                0
    ffffff801078b4b8 stream      0      0                0 ffffff801078b3f0                0                0
    ffffff801078bee0 stream      0      0                0 ffffff800fc65000                0                0 /var/run/mDNSResponder
    ffffff800fc65000 stream      0      0                0 ffffff801078bee0                0                0
    ffffff800fc65258 stream      0      0                0 ffffff800fc65320                0                0 /var/run/mDNSResponder
    ffffff800fc65320 stream      0      0                0 ffffff800fc65258                0                0
    ffffff800fc65640 stream      0      0                0 ffffff800fc65578                0                0 /var/run/mDNSResponder
    ffffff800fc65578 stream      0      0                0 ffffff800fc65640                0                0
    ffffff800fc65a28 stream      0      0                0 ffffff800fc65ed8                0                0
    ffffff800fc65ed8 stream      0      0                0 ffffff800fc65a28                0                0
    ffffff800e9f5bc0 stream      0      0                0 ffffff800e9f5710                0                0 /tmp/launchd-428.YVnMMM/sock
    ffffff800e9f5710 stream      0      0                0 ffffff800e9f5bc0                0                0
    ffffff800e9f5e18 stream      0      0                0 ffffff800fc65c80                0                0
    ffffff800fc65c80 stream      0      0                0 ffffff800e9f5e18                0                0
    ffffff800fc65bb8 stream      0      0                0 ffffff800fc66388                0                0
    ffffff800fc66388 stream      0      0                0 ffffff800fc65bb8                0                0
    ffffff800be6c578 stream      0      0                0 ffffff800e9f5d50                0                0
    ffffff800e9f5d50 stream      0      0                0 ffffff800be6c578                0                0
    ffffff800fc65e10 stream      0      0                0 ffffff800fc65d48                0                0
    ffffff800fc65d48 stream      0      0                0 ffffff800fc65e10                0                0
    ffffff800fc67d50 stream      0      0                0 ffffff800fc678a0                0                0
    ffffff800fc678a0 stream      0      0                0 ffffff800fc67d50                0                0
    ffffff800be6c000 stream      0      0                0 ffffff800be6c190                0                0
    ffffff800be6c190 stream      0      0                0 ffffff800be6c000                0                0
    ffffff800fc67648 stream      0      0                0 ffffff800be6c708                0                0
    ffffff800be6c708 stream      0      0                0 ffffff800fc67648                0                0
    ffffff800e9f5c88 stream      0      0                0 ffffff800e9f5648                0                0
    ffffff800e9f5648 stream      0      0                0 ffffff800e9f5c88                0                0
    ffffff800e9f5af8 stream      0      0 ffffff801034b550                0                0                0 /tmp/launch-yjdTuA/org.x:0
    ffffff800e9f4f40 stream      0      0 ffffff801034b740                0                0                0 /tmp/launch-JZ8kQ7/Listeners
    ffffff800e9f5198 stream      0      0 ffffff801034b930                0                0                0 /tmp/launch-Xv6peF/Render
    ffffff800e9f5968 stream      0      0 ffffff801034be08                0                0                0 /tmp/launchd-428.YVnMMM/sock
    ffffff800fc67a30 stream      0      0                0 ffffff800fc67af8                0                0 /var/run/mDNSResponder
    ffffff800fc67af8 stream      0      0                0 ffffff800fc67a30                0                0
    ffffff800cbd5ce8 stream      0      0                0 ffffff800cbd5b58                0                0 /var/run/mDNSResponder
    ffffff800cbd5b58 stream      0      0                0 ffffff800cbd5ce8                0                0
    ffffff800cbd5db0 stream      0      0                0 ffffff800cbd56a8                0                0 /var/run/mDNSResponder
    ffffff800cbd56a8 stream      0      0                0 ffffff800cbd5db0                0                0
    ffffff800ce4f008 stream      0      0                0 ffffff800ce4d3e8                0                0 /var/run/mDNSResponder
    ffffff800ce4d3e8 stream      0      0                0 ffffff800ce4f008                0                0
    ffffff800fc67710 stream      0      0                0 ffffff800fc67968                0                0 /var/run/mDNSResponder
    ffffff800fc67968 stream      0      0                0 ffffff800fc67710                0                0
    ffffff800fc677d8 stream      0      0 ffffff800ff25c18                0                0                0 /var/amavis/amavisd.sock
    ffffff800e9f3190 stream      0      0                0 ffffff800e9f30c8                0                0 /var/tmp/launchd/sock
    ffffff800e9f30c8 stream      0      0                0 ffffff800e9f3190                0                0
    ffffff800fc67ee0 stream      0      0                0 ffffff800e9f3000                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800e9f3000 stream      0      0                0 ffffff800fc67ee0                0                0
    ffffff800e9f3ed8 stream      0      0                0 ffffff800e9f3640                0                0 /var/run/mDNSResponder
    ffffff800e9f3640 stream      0      0                0 ffffff800e9f3ed8                0                0
    ffffff800e9f3bb8 stream      0      0                0 ffffff800e9f53f0                0                0 /var/run/mDNSResponder
    ffffff800e9f53f0 stream      0      0                0 ffffff800e9f3bb8                0                0
    ffffff800e9f3fa0 stream      0      0                0 ffffff800e9f3af0                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800e9f3af0 stream      0      0                0 ffffff800e9f3fa0                0                0
    ffffff800e9f3e10 stream      0      0                0 ffffff800e9f3960                0                0 /var/run/mDNSResponder
    ffffff800e9f3960 stream      0      0                0 ffffff800e9f3e10                0                0
    ffffff800cd894b0 stream      0      0                0 ffffff800ce4daf0                0                0 /var/run/mDNSResponder
    ffffff800ce4daf0 stream      0      0                0 ffffff800cd894b0                0                0
    ffffff800cf124b8 stream      0      0                0 ffffff800cf12968                0                0 /var/run/mDNSResponder
    ffffff800cf12968 stream      0      0                0 ffffff800cf124b8                0                0
    ffffff800ce4f968 stream      0      0                0 ffffff800cbd4e10                0                0 /var/run/mDNSResponder
    ffffff800cbd4e10 stream      0      0                0 ffffff800ce4f968                0                0
    ffffff800be6de78 stream      0      0                0 ffffff800cbd6bc0                0                0 /var/run/mDNSResponder
    ffffff800cbd6bc0 stream      0      0                0 ffffff800be6de78                0                0
    ffffff800cbd6af8 stream      0      0 ffffff800f245e88                0                0                0 /var/run/passwordserver
    ffffff800e9f4c20 stream      0      0                0                0                0                0
    ffffff800cbd4000 stream      0      0                0 ffffff800ce4fa30                0                0 /var/run/mDNSResponder
    ffffff800ce4fa30 stream      0      0                0 ffffff800cbd4000                0                0
    ffffff800e9f4450 stream      0      0                0 ffffff800e9f4518                0                0 /var/run/mDNSResponder
    ffffff800e9f4518 stream      0      0                0 ffffff800e9f4450                0                0
    ffffff800ce4da28 stream      0      0                0 ffffff800cd8af40                0                0 /var/run/mDNSResponder
    ffffff800cd8af40 stream      0      0                0 ffffff800ce4da28                0                0
    ffffff800e9f4e78 stream      0      0                0                0                0                0
    ffffff800e9f58a0 stream      0      0                0 ffffff800e9f5a30                0                0 /var/run/mDNSResponder
    ffffff800e9f5a30 stream      0      0                0 ffffff800e9f58a0                0                0
    ffffff800e9f57d8 stream      0      0                0 ffffff800e9f54b8                0                0
    ffffff800e9f54b8 stream      0      0                0 ffffff800e9f57d8                0                0
    ffffff800cf103e8 stream      0      0 ffffff800e9b1f80                0                0                0 /var/run/racoon.sock
    ffffff800cf10258 stream      0      0                0 ffffff800cf10320                0                0 /var/tmp/launchd/sock
    ffffff800cf10320 stream      0      0                0 ffffff800cf10258                0                0
    ffffff800cf104b0 stream      0      0                0 ffffff800cf10578                0                0
    ffffff800cf10578 stream      0      0                0 ffffff800cf104b0                0                0
    ffffff800cf10960 stream      0      0                0 ffffff800cf10640                0                0 /var/run/vpncontrol.sock
    ffffff800cf10640 stream      0      0                0 ffffff800cf10960                0                0
    ffffff800cf10898 stream      0      0                0 ffffff800cf107d0                0                0
    ffffff800cf107d0 stream      0      0                0 ffffff800cf10898                0                0
    ffffff800cf10708 stream      0      0 ffffff800e98b740                0                0                0 /var/amavis/clamd
    ffffff800cf10a28 stream      0      0 ffffff800e95b170                0                0                0 /var/run/dovecot/quota-warning
    ffffff800cf10af0 stream      0      0 ffffff800e95b268                0                0                0 /var/run/dovecot/quota-exceeded
    ffffff800cf10bb8 stream      0      0 ffffff800e95b360                0                0                0 /var/run/dovecot/anvil-auth-penalty
    ffffff800cf10c80 stream      0      0 ffffff800e95b458                0                0                0 /var/run/dovecot/anvil
    ffffff800cf10d48 stream      0      0 ffffff800e95b550                0                0                0 /var/run/dovecot/auth-worker
    ffffff800cf10e10 stream      0      0 ffffff800e95b648                0                0                0 /var/run/dovecot/auth-master
    ffffff800cf10ed8 stream      0      0 ffffff800e95b740                0                0                0 /var/run/dovecot/auth-userdb
    ffffff800cf10fa0 stream      0      0 ffffff800e95b838                0                0                0 /var/run/dovecot/auth-client
    ffffff800cf11068 stream      0      0 ffffff800e95b930                0                0                0 /var/run/dovecot/auth-login
    ffffff800cf11130 stream      0      0 ffffff800e95ba28                0                0                0 /var/run/dovecot/login/login
    ffffff800cf111f8 stream      0      0 ffffff800e95bb20                0                0                0 /var/run/dovecot/config
    ffffff800cf112c0 stream      0      0 ffffff800e95bc18                0                0                0 /var/run/dovecot/dict
    ffffff800cf11388 stream      0      0 ffffff800e95bd10                0                0                0 /var/run/dovecot/director-userdb
    ffffff800cf11450 stream      0      0 ffffff800e95be08                0                0                0 /var/run/dovecot/director-admin
    ffffff800cf11518 stream      0      0 ffffff800e95bf00                0                0                0 /var/run/dovecot/login/dns-client
    ffffff800cf115e0 stream      0      0 ffffff800e939000                0                0                0 /var/run/dovecot/dns-client
    ffffff800cf116a8 stream      0      0 ffffff800e9390f8                0                0                0 /var/run/dovecot/doveadm-server
    ffffff800cf11770 stream      0      0 ffffff800e9391f0                0                0                0 /var/run/dovecot/login/imap
    ffffff800cf11838 stream      0      0 ffffff800e9392e8                0                0                0 /var/run/dovecot/lmtp
    ffffff800cf11900 stream      0      0 ffffff800e9393e0                0                0                0 /var/run/dovecot/login/pop3
    ffffff800cf119c8 stream      0      0 ffffff800e9394d8                0                0                0 /var/run/dovecot/login/ssl-params
    ffffff800cf11a90 stream      0      0 ffffff800e9395d0                0                0                0 /var/run/dovecot/login/sieve
    ffffff800cf11b58 stream      0      0                0 ffffff800cf11c20                0                0
    ffffff800cf11c20 stream      0      0                0 ffffff800cf11b58                0                0
    ffffff800cf11ce8 stream      0      0                0 ffffff800cf11db0                0                0 /var/run/mDNSResponder
    ffffff800cf11db0 stream      0      0                0 ffffff800cf11ce8                0                0
    ffffff800cf11e78 stream      0      0                0 ffffff800cf11f40                0                0 /var/run/mDNSResponder
    ffffff800cf11f40 stream      0      0                0 ffffff800cf11e78                0                0
    ffffff800cf12008 stream      0      0                0 ffffff800cf120d0                0                0 /var/run/mDNSResponder
    ffffff800cf120d0 stream      0      0                0 ffffff800cf12008                0                0
    ffffff800cf12198 stream      0      0                0 ffffff800cbd52c0                0                0 /var/run/mDNSResponder
    ffffff800cbd52c0 stream      0      0                0 ffffff800cf12198                0                0
    ffffff800cbd5130 stream      0      0                0 ffffff800cbd4fa0                0                0 /var/run/mDNSResponder
    ffffff800cbd4fa0 stream      0      0                0 ffffff800cbd5130                0                0
    ffffff800cbd4640 stream      0      0 ffffff800e7f5078                0                0                0 /var/pgsql_socket/.s.PGSQL.5432
    ffffff800cbd4960 stream      0      0                0 ffffff800cbd5450                0                0 /var/run/mDNSResponder
    ffffff800cbd5450 stream      0      0                0 ffffff800cbd4960                0                0
    ffffff800cd8a770 stream      0      0                0 ffffff800cd8a838                0                0 /var/run/mDNSResponder
    ffffff800cd8a838 stream      0      0                0 ffffff800cd8a770                0                0
    ffffff800cbd55e0 stream      0      0                0 ffffff800be6cc80                0    

    Hop
    T1
    T2
    T3
    Best
    Graph
    IP
    Hostname
    Dist
    TTL
    Ctry
    Time
    1
    0
    0
    0.5 ms
    174.133.202.225 AS21844
    THEPLANET-AS
    e1.ca.85ae.static.theplanet.com.
    255
    US
    Unix: 15:13:33.260
    2
    0
    0
    0.5 ms  [+0ms]
    74.55.252.89 AS21844
    THEPLANET-AS
    te1-8.dsr01.hstntx2.networklayer.com.
    0 miles [+0]
    254
    US
    Unix: 15:13:33.290
    3
    62
    0
    0.5 ms [+0ms]
    173.192.18.232 AS36351
    SOFTLAYER
    ae16.bbr01.sr02.hou02.networklayer.com.
    0 miles [+0]
    253
    US
    Unix: 15:13:33.369
    4
    0
    59
    0.8 ms [+0ms]
    4.59.126.13 AS3356
    Level3
    xe-9-3-0.bar2.houston1.level3.net.
    0 miles [+0]
    251
    US
    Unix: 15:13:33.385
    5
    1
    1
    1.0 ms [+0ms]
    4.69.137.133 AS3356
    Level3
    ae-0-11.bar1.houston1.level3.net.
    0 miles [+0]
    251
    US
    Unix: 15:13:33.445
    6
    15
    8
    7.8 ms  [+6ms]
    4.69.137.138 AS3356
    Level3
    ae-13-13.ebr1.dallas1.level3.net.
    0 miles [+0]
    58
    US
    [Router did not respond]
    7
    7
    7
    7.8 ms   [+0ms]
    4.69.151.161 AS3356
    Level3
    ae-91-91.csw4.dallas1.level3.net.
    0 miles [+0]
    59
    US
    [Router did not respond]
    8
    7
    7
    7.8 ms [+0ms]
    4.69.145.210 AS3356
    Level3
    ae-4-90.edge10.dallas1.level3.net.
    0 miles [+0]
    250
    US
    Unix: 15:13:33.519
    9
    8
    8
    8.7 ms [+0ms]
    4.68.62.230 AS3356
    Level3
    att.
    0 miles [+0]
    249
    US
    [Router did not respond]
    10
    16
    15
    13 ms  [+4ms]
    12.123.16.86 AS7018
    ATT-INTERNET4
    cr1.dlstx.ip.att.net.
    0 miles [+0]
    243
    US
    [Router did not respond]
    11
    14
    13
    13 ms   [+0ms]
    12.123.18.109 AS7018
    ATT-INTERNET4
    cr83.dlstx.ip.att.net.
    0 miles [+0]
    244
    US
    [Router did not respond]
    12
    13
    24
    13 ms [+0ms]
    12.122.139.249 AS7018
    ATT-INTERNET4
    gar1.ocyok.ip.att.net.
    0 miles [+0]
    245
    US
    [Router did not respond]
    13
    24
    24 ms  [+10ms]
    67.219.175.18 AS11067
    PTSINET
    67-219-175-18.ptsi.net.
    0 miles [+0]
    243
    US
    [Router did not respond]
    14
    24
    35
    24 ms [+0ms]
    67.219.175.18 AS11067
    PTSINET
    67-219-175-18.ptsi.net.
    0 miles [+0]
    243
    US
    [Router did not respond]
    15
    33
    34
    33 ms [+9ms]
    216.251.21.2 AS11067
    PTSINET
    [Reached Destination]216-251-21-2.ptsi.net.
    0 miles [+0]
    51
    US
    Unix: 1:49:58.959
    16

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • How to retain socket connection for multiple requests in java 1.3

    Hi All,
    My problem is to retain client socket connection without opening and closing socket connection for every request.I want to open the socket connection once and send multiple requests one after the other based upon the response over the same socket.Finally I want to close the socket only after completing all my requests and receiving respective responses.I don't want to open and close the socket for each request and response.While at the same time I expect the socket to send each request only after receiving the response for the previous request.
    I am using java 1.3 and I am looking for the solution in same version.
    Please help me .
    Thanx in advance.

    Look at my response to "Telnet to Unix box from Java"
    http://forum.java.sun.com/thread.jsp?forum=31&thread=437231
    on "Java Programming" forum. It does exactly that to run the signon and a command. It would be easy to extend it to do multiple commands.

  • Socket connection

    Hi,
    I want to connect swf file running in www.xxx.com via socket
    to www.xxx.com:25
    My crossdomain.xml looks like:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "
    http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-access-from domain="www.xxx.com/*" to-ports="25"
    />
    </cross-domain-policy>
    But when i do remote debug i see this error:
    Se ha detenido la conexión con www.vescovoweb.com:25 -
    no se permite desde
    http://www.xxx.com/ct.swf
    securityErrorHandler: [SecurityErrorEvent
    type="securityError" bubbles=false cancelable=false eventPhase=2
    text="Error #2048: Violación de la seguridad Sandbox:
    http://www.xxx.com/ct.swf no
    puede cargar datos desde www.xxx.com:25."]
    Anyone can help me?

    It's the socket constructor:
    public function SendMail(host:String = null, port:uint = 0)
    try
    Security.loadPolicyFile("
    http://" + host + "/crossdomain.xml");
    } catch (error:Error){
    trace('NO crossdomain.xml\n'+error.message+'\n');
    socket = new Socket();
    configureListeners(socket);
    try {
    trace("Trying to connect to " + host + ":" + port + "\n");
    socket.connect(host, port);
    } catch (error:Error) {
    trace(error.message + "\n");
    socket.close();
    In the third row i load the policy file but i suppose the
    loading is fine because flash don't tell me any error when it's
    load.
    Any suggestion?

  • Socket connections / smtp

    I have a form that sends mail (smtp) through a socket
    connection (actionscript), which I picked up here,
    http://www.bytearray.org/?p=27
    Tested and works fine locally, but when posted online and
    tested, it quietly fails.
    I am trying to send mail from my domain, to the mail function
    within my host server. (same domain).
    Tried both "local" and "network" publishing options.
    I have read the article on socket security at
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
    but I do not have the option to place a crossdomain.xml file
    at port 843 since I am on a shared server.
    I've read everything that I can online but because policy
    changes from player 9,0,115,0 on, it seems that older posts may not
    be relevant, so is there another way to approach this matter?
    Is it possible for me to hard code the cross domain policy
    into my scripts or .fla?
    Thanks,
    Key.

    I seem to be having the same problems, I can't make a
    connection using the newest player and I have my crossdomain file
    on the root of the server, does anyone have any clue how to solve
    this.

  • Socket connection between Java and C

    I want to establish socket connection between Java client and C server (on Unix). Can anybody tell how to do it? Will the socket created in client be available in server. I tried out but there was no response from the server.

    We too can't connect the daemon server written by "c". The phenomena is below.
    << Execution of this Question1.class >> ---------------------------------------
    [kazuyuki@CryptOne tmp]$ java Question1 E 1.2.3.4 MFrame.java 195.211.1.1 15021
    << Output message >> ----------------------------------------------------------
    Quetion1 : flg_ = E
    Quetion1 : key_ = 1.2.3.4
    Quetion1 : fn_ = MFrame.java
    Quetion1 : adr_ = CryptOne.localhost/195.211.1.1
    Quetion1 : port_ = 15021
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
         at java.net.Socket.<init>(Socket.java:268)
         at java.net.Socket.<init>(Socket.java:122)
         at Question1.UPLOAD(Question1.java:65)
         at Question1.main(Question1.java:155)
    << Question >> ----------------------------------------------------------------
    Why the event "java.net.ConnectException: Connection refused" has occured ?
    The server to connect from Question1 can accept the connection request from
    the client program coded by "c" program. We have written down the daemon server
    program by "c" code tcp/ip socket functions (socket, bind, listen, accept).
    Security manager admits the access from this Question1.class, we have checked.
    Would you like please answer this Connction refuse occurrence ?
                                                                     2002.05.18 11:50:00.0(JST)
                                                                     K.Masuda
    << Java client code>> -------------------------------------------------
         (c)Copyright     All rights reserved.
              K.Masuda     2002.05.18
                   << Question1.java >>
    import     java.lang.String;
    import     java.io.InputStream;
    import     java.io.OutputStream;
    import     java.io.DataInputStream;
    import     java.io.DataOutputStream;
    import     java.io.FileInputStream;
    import     java.io.FileOutputStream;
    import     java.io.IOException;
    import     java.io.FileNotFoundException;
    import     java.net.Socket;
    import     java.net.InetAddress;
    import     java.net.UnknownHostException;
    import     java.net.ConnectException;
    import     java.net.NoRouteToHostException;
    class Question1 {
         char               flg_;
         String               key_;
         String               fn_;
         InetAddress          adr_;
         int                    port_;
         Socket               sock_;
         Question1(
              char          flg,
              String          key,
              String          fn,
              String          adr,
              int               port
              flg_     = flg;     
              key_     = key;
              fn_          = fn;
              try{
                   adr_     = InetAddress.getByName( adr );
              catch( UnknownHostException e ){
                   e.printStackTrace();
              port_     = port;
    System.out.println( "Quetion1 : flg_ = " + flg_ );
    System.out.println( "Quetion1 : key_ = " + key_ );
    System.out.println( "Quetion1 : fn_ = " + fn_ );
    System.out.println( "Quetion1 : adr_ = " + adr_ );
    System.out.println( "Quetion1 : port_ = " + port_ );
         public void UPLOAD(
              try{
                   sock_     = new Socket( adr_, port_ );
                   UpLoad();
                   DnLoad();
                   sock_.close();
              catch( UnknownHostException e ){
                   e.printStackTrace();
              catch( ConnectException e ){
                   e.printStackTrace();
              catch( NoRouteToHostException e ){
                   e.printStackTrace();
              catch( IOException e ){
                   e.printStackTrace();
         public void UpLoad(
              byte[]                         buf          = new byte[ 512 ];
              int                              rlen;
              int                              wlen;
              try {
                   OutputStream          sos          = sock_.getOutputStream();
                   FileInputStream          fis          = new FileInputStream( fn_ );
                   DataInputStream          dis          = new DataInputStream( fis );
                   DataOutputStream     dos          = new DataOutputStream( sos );
                   while( ( rlen =     dis.read( buf, 0, buf.length ) ) >= 0 ){
                        dos.write( buf, 0, rlen );
                   dis.close();
                   dos.close();
                   fis.close();
                   sos.close();
              catch( IOException e ){
                   e.printStackTrace();
         public void DnLoad(
              byte[]                         buf          = new byte[ 512 ];
              int                              rlen;
              int                              wlen;
              try {
                   InputStream               sis          = sock_.getInputStream();
                   FileOutputStream     fos          = new FileOutputStream( fn_ + ".cry" );
                   DataInputStream          dis          = new DataInputStream( sis );
                   DataOutputStream     dos          = new DataOutputStream( fos );
                   while( ( rlen =     dis.read( buf, 0, buf.length ) ) >= 0 ){
                        dos.write( buf, 0, rlen );
                   dis.close();
                   dos.close();
                   fos.close();
                   sis.close();
              catch( IOException e ){
                   e.printStackTrace();
         public static void main(
              String[] args
              char[]     chrs     = ( new String( args[ 0 ] ) ).toCharArray();
              Question1     clnt     = new Question1(
                                                                     // E or D
                                            chrs[ 0 ],
                                            args[ 1 ],               // key string
                                            args[ 2 ],               // file to be processed
                                            args[ 3 ],               // IP address
                                                                     // port
                                            Integer.parseInt( args[ 4 ] )
              clnt.UPLOAD();
    }

  • Socket connection - Available Port Numbers

    Hi,
    I am trying to connect to a server running on Unix through my NT client. This is being done via socket connection and by supplying IP Address of the machine plus the port number.
    My server is running on Unix, Solaris 8, Ultra 5 machine. I want to know if there is some allowable range of Port Numbers on the Unix machine?
    Or is it that I can use any number starting from 1 to infinite as my port number?
    Thanks.

    The ports below 1024 are reserver for only the "root" user and 65536 is usually the max port
    number available. Ports below 1024 are also reserved for a user in the Administrators group on NT and W2K.
    Actually, the maximum port number is 65535 since IPv4 port numbers are 16 bit quantities and that is the maximum value of a 16 bit quantity.

  • Non-blocking socket concurrent limitation?

    I have 2 socket program,one is server side used nio package with JDK1.4.1,the other is client used traditional socket,the client will initialize about 50
    threads trying to connect with server when starting,but only about 15
    can be accepted,these 2 program are runnning in the same computer which
    OS is win2000 professional PC.
    the followd is these code:
    please make a probe with them ,and tell me what's going on?
    server:
    package nio_select_demo;
    import java.io.*;
    import java.net.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.util.*;
    import java.nio.charset.Charset;
    import java.nio.charset.CharsetDecoder;
    public class Server implements Runnable
    // The port we will listen on
    private int port;
    // A pre-allocated buffer for processing data
    private final ByteBuffer buffer = ByteBuffer.allocate( 16384 );
    private ByteBuffer resBuf = ByteBuffer.allocate( 128 );
    Selector selector;
    AddInfo test ;
    public Server( int port ) {
    this.port = port;
    // for (int i=0; i<threadnum; ++i) {
    new Thread( this ).start();
    test = new AddInfo();
    test.start();
    public void run() {
    try {
    // create a ServerSocketChannel
    ServerSocketChannel ssc1 = ServerSocketChannel.open();
    // ServerSocketChannel ssc2 = ServerSocketChannel.open();
    // Set it to non-blocking
    ssc1.configureBlocking( false );
    // Get the Socket connected to this channel, and bind it
    // to the listening port
    ServerSocket ss = ssc1.socket();
    InetSocketAddress isa = new InetSocketAddress( port );
    ss.bind( isa , 60 );
    // Create a new Selector for selecting
    selector = Selector.open();
    // Register the ServerSocketChannel, so we can
    // listen for incoming connections
    ssc1.register( selector, SelectionKey.OP_ACCEPT );
    System.out.println( "Listening on port "+port );
    int n = 0;
    while (true) {
    // See if we've had any activity -- either
    // an incoming connection, or incoming data on an
    // existing connection
    int num = selector.select();
    // If we don't have any activity, loop around and wait
    // again
    if (num == 0) {
    continue;
    // Get the keys corresponding to the activity
    // that has been detected, and process them
    // one by one
    Set keys = selector.selectedKeys();
    Iterator it = keys.iterator();
    while (it.hasNext()) {
    // Get a key representing one of bits of I/O
    // activity
    SelectionKey key = (SelectionKey)it.next();
    // What kind of activity is it?
    if ((key.readyOps() & SelectionKey.OP_ACCEPT) ==
    SelectionKey.OP_ACCEPT) {
    System.out.println( "accept request" );
    // It's an incoming connection.
    // Register this socket with the Selector
    // so we can listen for input on it
    SocketChannel sc = ((ServerSocketChannel)key.channel()).accept();
    System.out.println( "Got connection from "+sc.socket());
    // Make sure to make it non-blocking, so we can
    // use a selector on it.
    //SocketChannel sc = s.getChannel();
    sc.configureBlocking( false );
    // Register it with the selector, for reading
    sc.register( selector, SelectionKey.OP_READ| SelectionKey.OP_WRITE);
    } else if ((key.readyOps() & SelectionKey.OP_READ) ==
    SelectionKey.OP_READ) {
    //ssc.register(selector , SelectionKey.OP_READ);
    SocketChannel sc = null;
    try {
    // It's incoming data on a connection, so
    // process it
    sc = (SocketChannel)key.channel();
    Socket s1 = sc.socket();
    s1.setTcpNoDelay(true);
    System.out.println( "enter processing data" );
    boolean ok = processInput( key );
    synchronized (selector) {
    key.interestOps(key.interestOps() & ~SelectionKey.OP_READ);
    // If the connection is dead, then remove it
    // from the selector and close it
    if (!ok) {
    key.cancel();
    System.out.println("dead");
    Socket s = null;
    try {
    s = sc.socket();
    s.close();
    } catch( IOException ie ) {
    System.err.println( "Error closing socket "+s+": "+ie );
    } catch( IOException ie ) {
    ie.printStackTrace();
    // On exception, remove this channel from the selector
    key.cancel();
    System.err.println( "Error raised in this socket");
    try {
    sc.close();
    } catch( IOException ie2 ) { System.out.println( ie2 ); }
    System.out.println( "Closed "+sc );
    else if ((key.readyOps() & SelectionKey.OP_WRITE) ==
    SelectionKey.OP_WRITE) {
    System.out.println("Enter Writing");
    String response = new String();
    if((response=this.test.getInfo())!=null){
    resBuf.clear();
    SocketChannel sc = (SocketChannel)key.channel();
    resBuf = ByteBuffer.wrap( response.getBytes("ISO-8859-1" ) );
    sc.write( resBuf );
    synchronized (selector) {
    key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
    // We remove the selected keys, because we've dealt
    // with them.
    keys.clear();
    } catch( IOException ie ) {
    System.err.println( ie );
    private boolean processInput( SelectionKey key ) throws IOException {
    buffer.clear();
    SocketChannel sc = (SocketChannel)key.channel();
    sc.read( buffer );
    buffer.flip();
    String response = new String("response ok");
    // If no data, close the connection
    if (buffer.limit()==0) {
    return false;
    Charset charset=Charset.forName("ISO-8859-1");
    CharsetDecoder decoder = charset.newDecoder();
    CharBuffer charBuffer = decoder.decode(buffer);
    System.out.println(charBuffer.toString());
    System.out.println( "Processed "+buffer.limit()+" from "+sc );
    return true;
    static public void main( String args[] ) throws Exception {
    int port = Integer.parseInt( args[0] );
    System.out.println(port);
    new Server( port );
    cilent:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Client implements Runnable
    private String host;
    private int port;
    private int acport;
    //the size of buffer on how much we write and read per cycle
    private static final int maxWriteSize = 128;
    public Client( String host, int port, int numThreads ) {
    this.host = host;
    this.port = port;
    for(int i =0;i<50;i++){//initialize 50 client threads
    new Thread(this).start();
    public void run() {
    byte buffer[] = new byte[maxWriteSize];
    byte buffer2[] = new byte[maxWriteSize];
    try {
    Socket s = new Socket( );
    InetSocketAddress sa = new InetSocketAddress(host,this.port);
    s.connect(sa);
    System.out.println(s);
    s.setTcpNoDelay(true);
    InputStream in = s.getInputStream();
    OutputStream out = s.getOutputStream();
    for (int i=0; i<maxWriteSize; ++i) {
    buffer[i] = (byte)'a';
    out.write( buffer, 0, maxWriteSize );
    int pause = 500;
    in.read( buffer , 0 , maxWriteSize );
    System.out.println( Thread.currentThread()+" wrote "+maxWriteSize);
    String res = new String ( buffer );
    String res2 = new String ( buffer2 );
    System.out.println( res );
    try { Thread.sleep( pause ); } catch( InterruptedException ie ) {}
    } catch( Exception ie ) {
    ie.printStackTrace();
    System.err.println(ie.getMessage());
    static public void main( String args[] ) throws Exception {
    String host = "127.0.0.1";
    int port = Integer.parseInt( args[0] );
    int numThreads = Integer.parseInt( args[1] );
    new Client( host, port, numThreads );

    I have found the reason!!!
    because of system resource limitation,windows can't afford to maintain
    so many concurrent stream-IO,so some socket will be closed.
    I modified the client side code,adding thes segments to client instantialize
    such as :
    public Client( String host, int port, int numThreads ) {
    for(int i =0;i<1000;i++){
    new Thread(this).start();
    try {
    Thread.currentThread().sleep(100);//give system some idle
    } catch (InterruptedException e) {
    /* ignore */
    then the server can accept more than 1000 client request concurrently.

Maybe you are looking for

  • A new iPad and new Express, but no Mac - can't set up network!

    Here's a puzzler (for me at least) -- Mom bought a new iPad and new Airport Express. She has no Mac, so no iTunes and no syncing. Her iPad does NOT have Airport Utility. She's starting from scratch. Her Express is connected to her Cox Cable Cisco mod

  • Preview not showing pdf document.

    Preview 8.0 has stopped showing some of my pdf documents when opened.  the documents show up as thumbnails but not on the main document space which is blank.  it will temporarily show but then goes blank in a second.  i recently upgraded to Yosemite

  • How to re-import podcasts

    I have about 400 podcasts in my iTunes library. They are all imported correctly -- that is, they show up as Podcasts, not as files in the Music Library. Now, I need to re-format my iPod, and re-import everything. I have no problem importing my MP3 fi

  • Geting error when build installer

    I'm getting Error 33 and dotnet x86 ni language pack error and build stops how can I solve this issue? Building executable is fine, but the problem occurs during building installer. Please advice regards Pierre Tannoury Pevatech International S.A.R.L

  • OWA; Query number of messages in inbox

    Hello all, Is there a way, from Java, to ask the Exchange server how many messages are in a users' inbox and how many of them are new? We want to write a simple text display iView that shows only the text 'Inbox #(<b></b>)', where '#' is number of me