Sockets will not close problem

Hi all,
We have a cient/server system that handles many connections using a dynamic pool of sockets (grows to a maximum and shrinks when not in use) spawned from a ServerSocket. The clients come and go with great frequency. They connect, pass some info, and disconnect again. The protocol implemented is that when the client wants to disconnect, it tells the server that it is finished using one of the fields in the message, and the server does the disconnect. The server side code that reacts to such a request to disconnect is as follows (btw, this is nicely indented for real, but can't get it to look right here):
try
logger.log(3, "CLOSE CLIENT INPUT STREAM");
if(client_input != null)
client_input.close();
client_input = null;
} catch(Exception se)
logger.log(0, "Input Stream Close Error: "+ se);
try
logger.log(3, "CLOSE CLIENT OUTPUT STREAM");
if(client_output != null)
client_output.close();
client_output = null;
} catch(Exception se)
logger.log(0, "Output Stream Close Error: "+ se);
try
logger.log(3, "CLOSE CLIENT SOCKET");
if(clientSocket != null)
clientSocket.close();
clientSocket = null;
} catch(Exception se)
logger.log(0, "Client Socket Close Error: "+ se);
finally
if(clientSocket != null)
try
clientSocket.close();
clientSocket = null;
} catch(Exception ex)
{} // nothing can be done
By far most of the times this works perfectly. The problem is this. With some clients only (it's a public internet app and we get all kinds of clients, and it's not always the same client type where this happens - i.e. sometimes Win2000 using JDK 1.3.1, sometimes another) the server reports through the logger that the socket is closed and everthing appears OK, but it didn't really close the socket! Running netstat shows those connections as still ESTABLISHED. With the amount of re-connecting these clients do, it only takes 2 or 3 such "ill behaved clients" and we soon run up to our stated "maximum" number of sockets for the pool, and everything comes to a grinding halt!
Searched the forums and only found one (very old) topic similar to this, with no answer.
So the question is: IS THERE ANY WAY TO REALLY FORCE THE CLOSING OF A SOCKET AT THE SERVER END?
Any thoughts appreciated.
thanks,
glitch

Reposted all, with code tags
Hi all,
We have a cient/server system that handles many
connections using a dynamic pool of sockets (grows to
a maximum and shrinks when not in use) spawned from a
ServerSocket. The clients come and go with great
frequency. They connect, pass some info, and
disconnect again. The protocol implemented is that
when the client wants to disconnect, it tells the
server that it is finished using one of the fields in
the message, and the server does the disconnect. The
server side code that reacts to such a request to
disconnect is as follows (btw, this is nicely indented
for real, but can't get it to look right here):
try
logger.log(3, "CLOSE CLIENT INPUT STREAM");
if(client_input != null)
client_input.close();
client_input = null;
} catch(Exception se)
logger.log(0, "Input Stream Close Error: "+ se);
try
logger.log(3, "CLOSE CLIENT OUTPUT STREAM");
if(client_output != null)
client_output.close();
client_output = null;
} catch(Exception se)
logger.log(0, "Output Stream Close Error: "+ se);
try
logger.log(3, "CLOSE CLIENT SOCKET");
if(clientSocket != null)
clientSocket.close();
clientSocket = null;
} catch(Exception se)
logger.log(0, "Client Socket Close Error: "+
r: "+ se);
finally
if(clientSocket != null)
try
clientSocket.close();
clientSocket = null;
} catch(Exception ex)
{} // nothing can be done
>
By far most of the times this works perfectly. The
problem is this. With some clients only (it's a
public internet app and we get all kinds of clients,
and it's not always the same client type where this
happens - i.e. sometimes Win2000 using JDK 1.3.1,
sometimes another) the server reports through the
logger that the socket is closed and everthing appears
OK, but it didn't really close the socket! Running
netstat shows those connections as still ESTABLISHED.
With the amount of re-connecting these clients do, it
only takes 2 or 3 such "ill behaved clients" and we
soon run up to our stated "maximum" number of sockets
for the pool, and everything comes to a grinding
halt!
Searched the forums and only found one (very old)
topic similar to this, with no answer.
So the question is: IS THERE ANY WAY TO REALLY FORCE
THE CLOSING OF A SOCKET AT THE SERVER END?
Any thoughts appreciated.
thanks,
glitch

Similar Messages

  • The first tab will not close, and often does not load all of a page.

    When I open firefox, the first tab always has 'search bookmarks and history' in the address bar, instead of the url of my homepage, and it will not close.

    While trying to figure out a solution, I removed my themes and I closed the tabs I could, then clicked on the new tab button, doing so changed my original tab into an (Untitled) tab and created a new (Untitled) tab. I then found I couldn't close either tab, I clicked on new tab again, got a third (Untitled) tab, which again I couldn't close. I then closed Firefox choosing not to save. This appears to have fixed the problem; however I do not know which of the above action(s) resolved it.

  • My dad has a brand new iMac. If he quits an app, this window closes, but the app won't finish shutting down, Force quitting does not work.  Once another app is opened, it will not close either.  Now none of the apps are responding. Any ideas?

    My dad has a brand new iMac. If he quits an app, this window closes, but the app won't finish shutting down, Force quitting does not work.  Once another app is opened, it will not close either.  Now none of the apps on the dock are responding. I asked him to click on the apple, and drop down to "About this Mac", but that wouldn't open either. Any ideas?  If I was at his house, I would call Apple Care in a heartbeat, but am home with my sick daughter,,,  Thanks!

    For starters, have him open Disk Utility in Applications>Utilities, select the volume (the indented listing) and Verify Disk. If it reports any problems, have him try a Safe Boot by holding the Shift key at startup. This boot will take much longer than usual. It's checking and trying to repair the drive directory, if possible. Once in Safe Boot, have him repair Permissions.
    For other Disk repair remedies see
    http://support.apple.com/kb/TS1417
    Also, have him try a PRAM Reset. At the startup chime, hold down CMD-Option-P-R together, listen for two more chimes, total three, then let go to finish booting.
    Also, is he running any AV? If so, have him uninstall it. It might be responsible for this behavior. (There are no viruses for OS X.)

  • "Creating Adobe PDF" task will not close  H E L P

    "Creating Adobe PDF" task will not close after I print a .pdf document. I am running Windows XP Professional with Adobe Acrobat 8 Professional v 8.1.2. It doesn't matter what application I print from, this window stays open in the background. I have to minimize the window in the windows task bar, then restore the window, then click hide on the window to get it to close.
    Please help me, I have searched for a solution, but nothing seems to be out there. I can't be the only one having this problem.

    Has anyone had any luck resolving this issue? I had the problem for a long time and then it went away, I believe after I reinstalled Adobe because the updater had stopped working. Recently the issue began again, primarily with printing to PDF from Explorer. It seemed to start after a recent Microsoft update, so I am wondering if that was the culprit, though even if it is I have no idea how to correct it. When I can catch the "hide" button on the dialogue when it first launches the "creating adobe pdf" task, it sometimes closes itself. I have also noticed that it seems to re-appear on every OTHER print to PDF. I am running Adobe Acrobat 8 Professional, Version 8.2.5 on Windows XP Professional and Internet Explorer 7. Anyone? Help?

  • I updated our iPad a week ago to 8.1 (12B410) and since then most apps will not close down with the 4 fingers swiping in.

    I updated our iPad a week ago to 8.1 (12B410) and since then most apps will not close down with the 4 fingers swiping in. The only way to close them down is to hit the middle bottom button twice then swipe upwards. Is anyone else having this problem and how do I fix it?

    This has been happening to me as well with an iPad 3 running iOS 8.1. This is what I do and it works for me. Toggle the setting for Multitasking Gestures off and then on again, Settings>General>Multitasking Gestures>Off. Then toggle it on again.
    I have to repeat the sequence from time to time as I have not found a permanent fix. I think that iOS 8 is by far the buggiest iOS release that I have used since I have owned an iOS device.

  • ITunes will uses 100% cpu and will not close in OSX Lion

    When I start up iTunes, after a few minutes, the fan kicks on and Activity Monitor shows that it is using 100% CPU. The fan kicks up and the MBP gets warm. I have to force close to get it to shut down. iTunes match is constantly running, so maybe that has something to do with it?
    I'm not running it in Mini Player mode or anything like that, so I'm not sure what's causing the problem. Any thoughts on how to diagnose it?

    I also have this problem which has been getting worse with recent successive updates of Firefox. As a long-time user and advocate, I am about ready to look for an alternative browser. Firefox will not close and exit properly, requiring direct cancellation through Task Manager; starts up very slowly (often 1 to 2 minutes); and frequently locks up the CPU with 100% of cycles while doing NOTHING; offers to restart crashed sessions, but cannot recover and reload those sessions; will not operate correctly while any other application accesses the internet, like uTorrent. Firefox is set to delete cookies, etc. whenever the session closes, sqlite database is vacuumed regularly, CCleaner regularly wipes remaining accretions, and disk is defragged. Currently running 3.5.5 but will NOT upgrade until this problem is solved since later builds report the same problems. I know several other users who have experienced the same problem and I can no longer automatically recommend Firefox to users and clients. Is anybody paying any attention to this problem? What is being done to address this fault? Why is there no response to the original poster? Is this really a support forum or just a way to preoccupy and distract the users who suffer this malfunction? Wireless 54Mbps connection. No Adobe Flash, QuickTime, MS Silverlight, etc. installed on this machine. Firefox 3.5.5 with the following add-ons:
    Aardvark 3.0
    Adblock Plus 1.2.1
    Adblock Plus: Element Hiding Helper 1.0.6
    Free Download Manager plugin 1.3.4
    Highlighter 0.1.4
    MR Tech Toolkit 6.0.4
    repagination 2006.4.5.1
    Save Complete 1.0.1
    Session Manager 0.6.8.3
    Tab Mix Plus 0.3.8.4
    Unhide Passwords 1.2.5.1
    User Agent Switcher 0.7.2
    Thanks for any help or suggestions.

  • Itunes library will not close down all the way

    My iTunes library will not close down all the way.  When I close the library I am unable to log back in or turn my computer off because itunes is still running although I x'd it out.

    You're right, you shouldn't have to do that.
    Well, you didn't say whether you've tried uninstalling & reinstalling itunes. Make sure it's installed with an admin user account. Then go into the WIndows Event Viewer and see if there are any error messages about any of the itunes processes in the installation package. That could give us a clue of what's going wrong.
    Another thing that could be causing the problem is the "apple push" part of itunes, APSDaemon.exe. Read wiclee's post here about it.
    https://discussions.apple.com/thread/3734882?start=0&tstart=0

  • My Safari Windows will not close

    My safari windows will not close. I can use the internet fine, but safari will not allow me to close or minimize the window. This is also stopping me from shutting down my computer without removing the battery. Should I take it in to get repaired, or is it a setting on my computer that got turned on? Is anyone else having the same problem? Thank you! - Kristen

    Hi Kristen,
    Welcome to Apple Discussions
    Which version of OS X are you using?
    For possible relief, go to your Finder. There, navigate to your User Account's Library>Preferences Folder. You'll see a file com.apple.safari.plist. Move it to the desktop and restart Safari.
    Please let me know if that changes anything.

  • The addons window will not close, and comes up with firefox

    I recently re-installed java, and when i opened firefox the add-ons window opened with it. the Add-ons window will not close without closing firefox, and turning the pc off, using ctr+alt+del wont work. any assistant will be greatly appreciated

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    See also "Corrupt extension files":
    * http://kb.mozillazine.org/Unable_to_install_themes_or_extensions

  • Third party software will not close without a soft reset.

    I have a few third party software utilities/games that do not want to close without a soft reset, some show a white screen and others just will not close. Should I uninstalll these and reinstall them? My grandson has the same utilities on his Treo 650 without these problems. My phone is the Treo 700p.
    Post relates to: Treo 700p (Verizon)

    I would try uninstalling and reinstalling the software. If this does not work, you may want to check if there are updates or newer versions of this program and be sure to check the compatibility.
    I hope this helps,
    -Pat

  • Adobe 10.1.7 will not close in task manager after you exit the program. High cpu

    Hello,
    Updated to 10.1.7 and noticed that when you close the program an instance of acrobat stays open in task manager with high 50%+ cpu usage. Will not close at all unless you end task. if you open adobe again a new instance opens again consuming more cpu and cripples the machine with high cpu. This is on win 8 64bit machine. Had the previous release 10.1.6 working for some time on the same machine with no issues.
    Thank you in advance

    Identical issue with Acrobat XI Pro on Windows 8 Pro 64 bit. After viewing PDF file, upon closing Acrobat, a new Background Process starts called Adobe Acrobat (32 bit) uses 18% of cpu.  I have left run for three to four hours and does not close.  If I open another PDF file and then close, a second Background Process of Adobe Acrobat (32 bit) start, also using 18% of cpu.  I was able to open a third PDF file and upon closing a third Background Process of Adobe Acrobat (32 bit) start, also using 18% of cpu.  I did not try more.  All three consume over 50% of processor and after an hour does not close.  Fan and cpu begin to run hot so I manual End Task.  I tried Repair Acrobat Installation command, did not fix.  After searching forum used the Adobe Reader and Acrobat Cleaner Tool (http://labs.adobe.com/downloads/acrobatcleaner.html) to uninstall.  Then downloaded Acrobat XI Pro from My Adobe account login.  Reinstalled software.  Issue gone, could not replicate even after several hours of trying.  Then Checked for Updates. After updates installed, loaded and brought to version 11.0.3, problem returned as before. I have PDF files on both local drive and NAS, been able to recreate issue on both.  In a PDF intensive environment, I was having to leave the task manager up and occasionally stop Background Process of Adobe Acrobat (32 bit) so as to keep processor usage and fan speed down, thanks to Goateye01 for the suggestion, I now leave Acrobat open and close the files, this way the background process hang does not occur.  Additional Note, only able to create issue with standalone application, issue does not occur when in IE10 and viewing PDF files.   Hopefully a fix or helpful guidance coming soon?
    Vaio model SVS151290X
    Intel Core i7-3632QM [email protected]
    12 GB Ram
    256 GB SSD

  • Roboformtaskbaricon process will not close after firefox 9 is shut down

    Hello,
    The roboformtaskbaricon.exe (v754) process will not close after firefox 901 is shut down. Although I could be wrong, my guess is that firefox is pushing this process out of firefox, forcing it to run on its own. If it's a roboform issue, then I will contact them.
    Thank you, bheart

    On the page below, scroll down to "RoboForm Controls", then scroll down to '''''4. Taskbar Icon''''' under that heading. It sounds as though this may be the item to which you are referring. From the name of the file '''''roboform<u>taskbaricon</u>.exe''''', it implies the Windows Task Bar rather than the Firefox toolbar.
    *http://www.roboform.com/support/manual/roboform#files
    For clarification of '''''roboformtaskbaricon.exe''''', its function and whether it should shut down when exiting Firefox, contact Roboform Online Support and leave full details of your question:
    *http://www.roboform.com/support/overview
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • CD Tray Will Not Close (iBook Dual USB 500MHz)

    I have a iBook Dual USB 500MHz that only has one problem: the CD tray will not close. I'd rather not disassemble it. How does the tray catch and where? Thanks!

    Hey Tom,
    I've got a Combo Drive here in a taken apart G3 500. I opened it up and took some pix. They're here:
    http://www.photolava.com/view/bsm8.html
    So to get here you'll have to remove the drive from the iBook and remove the top.
    You're looking at the locking mechanism and the manual release mechanism.
    So from what I see the things that could go wrong:
    1) That split ring could fall off and the latching hook would fall off/jam.
    2) The solenoid could be stuck in a retracted position or the return spring could
    fail.
    3) Either the latching hook or the latching solenoid hook could be broken.
    If you need help taking the Combo drive out eMail me.
    Richard

  • Mail Application will not close

    I am having a problem with my mail application. It will not close after I open it. I have to force quit. Anyone have any idea? I appreciate any help.

    So, how do I find the answer or the thread? I have the same problem and have worked on it for two days.

  • Mail won't display the viewer window, and it will not close (force quit does not show in menu bar).  Can't shut down to reboot because the open mail program prevents it.   Any advice?

    Mail does not show the viewer window even when new viewer window is cliced.  I tried to close mail and reopen, but it will not close, and force quit option does not appear in window bar.   I tried to shut down the computer and reboot, but it cannot close because of open mail program it says.    Help!

    Many thanks.  Once I was able to close mail, it reopened and behaved quite normally.  Thank you.  I'll remember the option quit for force quite!

Maybe you are looking for

  • How to Schedule a daily job for ELM

    Hi All,    We have a requirement to create prospects using ELM.However, we have to automate this process and run this as a regular batch job.    When checked ELM does not provide an option to run the job periodically.    Please suggest to resolve thi

  • Is there a way to create dependency on the real-time jobs

    Hi, We have around 80 real-time services running and loading the changed data into the target. The process being used is IBM Informix > IBM CDC > JMS (xml messages) > DS real-time services > Oracle EDW. While using the above process,  when ever there

  • SSRS Custom code

    Can we call custom code in parent report, which written in the subreport Thanks in advance

  • Mini will not boot disks from combo drive

    Mini was having "issues." Thought I would do a clean install to correct all problems. When I insert OSX install disk and hold "C" key the computer tries to boot from the disk. The grey screen and apple logo apear. But instead of then going to the lit

  • WRITE_BACK_INT of Class CL_UJR_WRITE_BACK in BPC 10.0

    Hi experts! I´m trying to write data from internal table to a BPC application (v 10.0). I read these links: [http://scn.sap.com/thread/1788887 | /thread/3143913] [http://scn.sap.com/thread/3143913 | /thread/3143913] and try to use method WRITE_BACK_I