Socket connection seems to drop frequently caused by DGCClient

Hello,
I am using RMI with SSL, but I recognize that calling remote methods often takes long time. I have investigated, that the the
createSocket function in my RMISSLClientSocketFactory is called very often and createSocket takes around 3 seconds because I am using SSL with a big key, but this is another story..
Sometimes after more or less 20 seconds the createSocket function is called by the framework, but I don't want to create new sockets very frequently.
In the stack trace I can see the following:
System Thread [RMI RenewClean-[192.168.1.60:2022,ApplicationRMISSLClientSocketFactory@ecb67f]] (Suspended (breakpoint at line 47 in ApplicationRMISSLClientSocketFactory))
ApplicationRMISSLClientSocketFactory.createSocket(String, int) line: 47
TCPEndpoint.newSocket() line: not available
TCPChannel.createConnection() line: not available
TCPChannel.newConnection() line: not available
UnicastRef.newCall(RemoteObject, Operation[], int, long) line: not available
DGCImpl_Stub.dirty(ObjID[], long, Lease) line: not available
DGCClient$EndpointEntry.makeDirtyCall(Set, long) line: not available
DGCClient$EndpointEntry.access$1600(DGCClient$EndpointEntry, Set, long) line: not available
DGCClient$EndpointEntry$RenewCleanThread.run() line: not available
Thread.run() line: not available
The DGCClient seems to be responsible for new socket creation. Is it possible to disable the DGC (distributed garbage collector), or to avoid that a new socket is created?
Addional info: if I start my client and server without making any traffic, a new socket is created exactly every 5 minutes.
thanks in advance,
Armin
www.lyth.de

createSocket function in my RMISSLClientSocketFactory is called very oftenIt shouldn't be. Does your RMISSLClientSocetFactory have an equals() method? It should read like this:
public boolean equals(Object that)
  return that != null&& this.getClass() == that.getClass();
}If you're using 1.5 or later you don't even need your own RMISSLClientSocketFactory: see javax.rmi.ssl.*.

Similar Messages

  • IPv6 Dropping Frequently Causing Disconnects

    I have got a DPC3939 Modem/Router combo. I get frequent disconnects from my Xbox and on my computer. I'll document the exact minute it happened and check the logs on my router. Sure enough there's a log at that exact minute, every single time I drop connection. Here's what I get. And I tried disabling both IPv4 and IPv6 firewalls entirely and it makes no difference. FW.IPv6 FORWARD drop, 348 Attempts.2015/8/01 00:22:20Firewall BlockedFW.IPv6 INPUT drop, 63 Attempts.2015/8/01 00:22:20Firewall Blocked Let me know if you know how I can fix this issue. Thanks!

    Not all routers and modems work well with Windows 7/Vista.
    See if there is firmware for your network equipment.
    Upgrade to Win7, much better WiFi and networking.

  • Wi-fi Connection seems to drop off!!!

    Hi,
    Has anyone had the problem recently about their iphone(4) dropping connection. It is quite random and has been happening for past few days. It automatically goes to 3g connection, which i dont like at all!! please help someone.
    Regards,
    Aparna.

    APPSUK wrote:
    Has anyone had the problem recently about their iphone(4) dropping connection.
    Possibly.  How about instead of asking the question try a search of the forums for similar issues.
    Or read the User's Guide and try basic troubleshooting.

  • My connection drops frequently; started happening recently.

    My connection drops frequently; started happening recently. Don't know why. The green light does not go off nor does my computer say I am not connected, but web pages do not load, and either takes a restart, or 5 minutes of waiting.

    I'm having the exact same problem - I have an Extreme 4th Gen and the networked harddisk (my fileserver) keeps dropping off and getting disconnected...really very annoying!
    Airport Update 7.6 seems to be the culprit - I backed it down to 7.5.2 and it stopped disconnecting but the incessant update notifications (pop-up Airport dialog, blinking green light on the device) and concerns about security moved me back to 7.6.
    I wish Apple do something about this.

  • After installing Mountain Lion on my MBP Retina, WiFi connection drops frequently (not happening to other devices around); it also takes a lot to reconnect after wake up.

    After installing Mountain Lion on my MBP Retina, the WiFi connection drops frequently (not happening to other devices around, like on an iPhone); it also takes a lot to reconnect after wake up. Does anybody have a solution for this?

    After installing Mountain Lion on my MBP Retina, the WiFi connection drops frequently (not happening to other devices around, like on an iPhone); it also takes a lot to reconnect after wake up. Does anybody have a solution for this?

  • HT4628 My Wi-Fi connection on my iMac drops frequently. The other computers in the house do not have this problem. If I go into the Network Preferences and choose my Network it connects immediately but it does not remember the setting.

    My Wi-Fi connection on my iMac drops frequently. The other computers in the house do not have this problem. If I go into the Network Preferences and choose my Network it connects immediately but it does not remember the setting and I must reselect my network frequently.

    The iMac picks up a wireless signal from the back of the screen, so you would want to avoid having it close to a wall, or in a confined area where the wireless signal cannot easily reach the iMac's antenna.
    We don't know how far the iMac is from your wireless router, or how many walls or other obstructions might be in the signal path that would limit the quality of signal that the iMac receives.
    Nor do we know whether you might have a cordless phone near the iMac, or whether you may be using a wireless keyboard and/or mouse....all of which can interfere with the wireless signal.
    Can you provide some more info on this?

  • Internet sessions, VPN session, and connections dropping frequently

    I'm in an apartment. This problem started about a week ago. All of my browser sessions, vpn session, and connections such as AIM or netflix drop frequently. I often have to click links twice to get a page to load. I have to reload videos a lot to get them to continue to stream. I am constantly signing in and out of AOL IM.
    I believe the problem has to do with several MoCs (coax connections) listed on my router page, and these MoCs have names of other people on them. Until I noticed them a week ago, I had only seen one MoC belonging to me listed on the router connection page.
    Thus, I think that something got crossed up of misconfigured in the ONT for my apartment complex. The gateway light on my router stays green as all of these problems happen.
    Pinging google.com, I get
    --- google.com ping statistics ---76 packets transmitted, 55 packets received, 27.6% packet lossround-trip min/avg/max/stddev = 31.282/39.339/48.217/3.548 ms
    Anyone seen this before and know how to get verizon to fix this?
    I have had nothing but problems with FIOS since getting it, and I have wasted a lot of time with their "customer support."

    I am sorry to hear about your connection problems. I have sent you a private message so we can get your information and look more deep into your connection.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • Clients seem to drop their connectivity intermittently

    Hi,
    We've been  having an intermittent issue where clients seem to drop their connectivity intermittently. We have an SSID configured with 802.1x and user-machine authentication using MS-PEAP.  ISE is currently used as the radius server,
    Synopsis:
    When the client drops out, it is associated to the AP at good signal strength -64dBm. All our clients are running Win7. Once the issue occurs a yellow exclamation mark appear across the system tray wireless icon and a message appears in the "Network and Sharing Center" that either says “no internet connection” AP status on the controller is associated  The client can ping its default gateway, but no connectivity above layer 3 appear to be working.  This behavior is extremely intermittent. The only way to restore full connectivity to the client is to hard reset the wireless adapter or switch to another SSID and go back to the problematic SSID.
    Today , I've worked with the same Cisco TAC engineer for almost three hours  trying to  diagnose and analyze this issue.  We've tried to diagnose several clients that were having  this issue by running debugs  on the controllers. The wireless controllers were showing the clients were still associated, yet the clients couldn't communicate with network. I ran a link-test from the controller to the affected clients and all came back with failed status.
    Any idea

    a link test could fail depending on the adapter and CCX. If the client can ping it's default gateway, then the issue is probably, more than likely, not the wireless. Pinging the GW proves the client is passing traffic out of the WLC and upstream. If they are not able to reach any resources you might want to look and check your CAM and arp table entries, it is entirely possible that a MAC is being spoofed, or an IP address is being stolen somewhere.
    HTH,
    Steve

  • Subsequent drop in no. of Socket connections

    Hi All ,
    I have created one application which uses lots of threading and socket connections (Both TCP and UDP).
    I am using Linux Server with following configuration
    1. Quad core processor
    2. 8 GB RAM
    3. Enough bandwidth for 10,000 simultaneous connections
    In this application I need to connect to more than 5000 different Servers at a time. But I could not succeed . The application is quite stable with around 3000-3500 connections and works fine in all aspects.
    Now when I tried to connect to 5000 connections it becomes quite unstable .
    Initially it was showing that Out of memory Error . Then I changed some VM arguments .
    My current VM arguments are
    export VM_ARG=" -Xms64m -Xmx1024m "
    export VM_ARG=$VM_ARG" -Xss75k "
    export VM_ARG=$VM_ARG" -XX:NewRatio=15 "
    export VM_ARG=$VM_ARG" -Djava.net.preferIPV6Addresses=false -ea -Djava.net.preferIPv4stack=true "
    #export VM_ARG=$VM_ARG" -verbose:gc "
    export VM_ARG=$VM_ARG" -XX:+UseParallelGC "Now It doesn't throw the Out of Memory that often but looses the connections quite often .
    I think I could not use the all capabilities of my system . Can any one suggest me some better options
    Thanks in Advance,
    -- Vishal

    You should be able to support around 1,000 - 3,000 threads with an up to date version of Linux.
    I think you have done very well if you have one thread per connection.
    If you want more connections you need to use non-blocking io and then you should be able to cut the number of threads to one or two per CPU.

  • Problem with socket connection

    have my gps reciver connected to the usb port - i have a daemon gpsd running which makes data available on tcp port 2947 for querying. when i do telnet, it gives proper data.
    but when i open a socket connection using java, it does not print anything as output. actually telnet asks for an escape charatcer so i am sending "r" initially to the server but still the program does not print anything as output.
    here is my java code -
    import java.io.*;
    import java.net.Socket;
    public class test2
    public static void main(String[] args)
    try
    Socket s = new Socket("localhost",2947);
    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
    s.getOutputStream())),true);
    out.println("r");
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
    String line;
    while(true)
    line = in.readLine();
    System.out.println(line);
    catch (Exception e)
    or sometimes it even shows error as
    Exception in thread "main" java.net.SocketException: Invalid argument or cannot assign requested address
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    and this is the output which i get on telnet -
    ot@localhost ~]# telnet localhost 2947
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    r
    GPSD,R=1
    $GPRMC,000212,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1A
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32
    $PGRME,400.00,0.00,0.00*7B
    $GPRMC,000213,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1B
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32
    $PGRME,400.00,0.00,0.00*7B
    $GPRMC,000214,V,18000.0000,N,00000.0000,W,0.0000,180.000,101102,,*1C
    $GPGSA,A,1,,,,,,,,,,,,,,,,*32

    Actually the problem does not seem to be in the code because i tried some basic client server programs (without any gpsd etc in picture) and even they are not working in linux though they work perfectly in windows (on the same machine). In linux it shows exception
    My socket programs dont work in linux it shows error -
    ot@localhost winc]# java parser
    Exception in thread "main" java.net.SocketException: Invalid argument or cannot assign requested address
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at java.net.Socket.<init>(Socket.java:309)
    at java.net.Socket.<init>(Socket.java:124)
    at parser.main(parser.java:10)
    i have removed the firewall settings etc and it still doesnot work in linux
    what could be the cause for this?
    Sowmya

  • Establishing a socket connection between a .swf file and a socket-test program (TCP/IP builder - Windows), in AS3.

    I have an issue with a college project I'm working on.
    Using Actionscript 3, I made a simple .swf program, an animated, interactive smiley, that 'reacts' to number inputs in a input-box.
    For the sake of the project, I now need to make the framework for establishing a socket connection with the smiley .swf, and another program.
    This is where I encounter issues. I have very little knowledge of AS3 programming, so I'm not certain how to establish the connection - what's required code-wise for it, that is.
    To test the connection, I'm attempting to use the "TCP/IP builder" program from windows, which lets me set up a server socket. I need to program the .swf file into a client - to recognize it, connect to it, then be able to receive data (so that the data can then be used to have the smiley 'react' to it - like how it does now with the input-box, only 'automatically' as it gets the data rather than by manual input).
    My attempts at coding it are as follows, using a tutorial (linked HERE):
    //SOCKET STUFF GOES HERE
        var socket:XMLSocket;        
        stage.addEventListener(MouseEvent.CLICK, doConnect); 
    // This one connects to local, port 9001, and applies event listeners
        function doConnect(evt:MouseEvent):void 
        stage.removeEventListener(MouseEvent.CLICK, doConnect); 
        socket = new XMLSocket("127.0.0.1", 9001);   
        socket.addEventListener(Event.CONNECT, onConnect); 
        socket.addEventListener(IOErrorEvent.IO_ERROR, onError); 
    // This traces the connection (lets us see it happened, or failed)
        function onConnect(evt:Event):void 
            trace("Connected"); 
            socket.removeEventListener(Event.CONNECT, onConnect); 
            socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
            socket.addEventListener(DataEvent.DATA, onDataReceived); 
            socket.addEventListener(Event.CLOSE, onSocketClose);             
            stage.addEventListener(KeyboardEvent.KEY_UP, keyUp); 
        function onError(evt:IOErrorEvent):void 
            trace("Connect failed"); 
            socket.removeEventListener(Event.CONNECT, onConnect); 
            socket.removeEventListener(IOErrorEvent.IO_ERROR, onError); 
            stage.addEventListener(MouseEvent.CLICK, doConnect); 
    // Here, the flash tracks what keyboard button is pressed.
    // If 'q' is pressed, the connection ends.
            function keyUp(evt:KeyboardEvent):void 
            if (evt.keyCode == 81) // the key code for q is 81 
                socket.send("exit"); 
            else 
                socket.send(evt.keyCode); 
    // This one should handle the data we get from the server.
            function onDataReceived(evt:DataEvent):void 
            try { 
                trace("From Server:",  evt.data ); 
            catch (e:Error) { 
                trace('error'); 
        function onSocketClose(evt:Event):void 
            trace("Connection Closed"); 
            stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp); 
            socket.removeEventListener(Event.CLOSE, onSocketClose); 
            socket.removeEventListener(DataEvent.DATA, onDataReceived);
    Trying to connect to the socket gives me either no result (other than a 'connection failed' message when I click the .swf), or the following error:
    Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Users/Marko/Desktop/Završni/Flash%20documents/Smiley%5FTCP%5FIP%5Fv4.swf cannot load data from 127.0.0.1:9001.
        at Smiley_TCP_IP_v4_fla::MainTimeline/doConnect()[Smiley_TCP_IP_v4_fla.MainTimeline::frame1:12] 

    Tried adding that particular integer code, ended up with either errors ("use of unspecified variable" and "implicit coercion") , or no effect whatsoever (despite tracing it).
    Noticed as well that the earlier socket code had the following for byte reading:
    "sock.bytesAvailable > 0" (reads any positive number)
    ...rather than your new:
    "sock.bytesAvailable != 0" (reads any negative/positive number)
    Any difference as far as stability/avoiding bugs goes?
    So then, I tried something different: Have the program turn the "msg" string variable, into a "sentnumber" number variable. This seemed to work nicely, tracing a NaN for text (expected), or tracing the number of an actual number.
    I also did a few alterations to the input box - it now no longer needs the 'enter' key to do the calculation, it updates the animation after any key release.
    With all this considered and the requirements of the project, I now have a few goals I want to achieve for the client, in the following order of priority:
    1) Have the "sentnumber" number variable be recognized by the inputbox layer, so that it puts it into the input box. So in effect, it goes: Connect -> Send data that is number (NaN's ignored) -> number put into input box -> key press on client makes animation react. I optionally might need a way to limit the number of digits that the animation reacts to (right now it uses 1-3 digit numbers, so if I get sent a huge number, it might cause issues).
    - If the NaN can't be ignored (breaks the math/calculus code or some other crash), I need some way of 'restricting' the data it reads to not include NaN's that might be sent.
    - Or for simplicity, should I just detect the traced "NaN" output, reacting by setting the number variable to be "0" in such cases?
    2) After achieving 1), I'll need to have the process be automatic - not requiring a keyboard presses from the client, but happening instantly once the data is sent during a working connection.
    - Can this be done by copying the huge amounts of math/calculus code from the inputbox layer, into the socket layer, right under where I create the "sentnumber" variable, and modifying it delicately?
    3) The connection still has some usability and user issues - since the connection happens only once, on frame 1, it only connects if I already have a listening server when I run the client, and client can't re-connect if the server socket doesn't restart itself.
    I believe to do this, I need to make the connection happen on demand, rather than once at the start.
    For the project's requirement, I also need to allow client users to define the IP / port it's going to connect to (since the only alternative so far is editing the client in flash pro).
    In other words, I need to make a "Connect" button and two textboxes (for IP and port, respectively), which do the following:
    - On pressing "Connect", the button sets whatever is in the text boxes as the address of the IP and port the socket will connect to, then connects to that address without issues (or with a error message if it can't due to wrong IP/port).
    - The connection needs to work for non-local addresses. Not sure if it can yet.
    - On re-pressing connect, the previous socket is closed, then creates a new socket (with new IP/port, if that was altered)
    It seems like making the button should be as simple as putting the existing socket code under the function of a button, but it also seems like it's going to cause issues similar to the 'looping frames' error.
    4) Optional addition: Have a scrolling textbox like the AIR server has, to track what the connection is doing on-the-fly.
    The end result would be a client that allows user to input IP/Port, connects on button press (optionally tracking/display what the socket is doing via scrollbox), automatically alters the smiley based on what numbers are sent whilst the connection lasts, and on subsequent button presses, makes a new connection after closing off the previous one.
    Dropbox link to new client version:
    https://www.dropbox.com/s/ybaa8zi4i6d7u6a/Smiley_TCP_IP_v7.fla?dl=0
    So, starting from 1), can I, and how can I, get the number variable recognized by "inputbox" layer's code? It keeps giving me 'unrecognized variable' errors.

  • Connection of PLEK400 Drops and All Lights Go Dark

    My computer is in my bedroom on the second floor, while my router is on the first. From the moment I got my computer I've had problems with the wireless connection (As in it NEVER worked), so I bought a Belkin Wi-FI extender that worked nicely for about a year. It was a done deal and all was fine, until a few weeks ago when it went bad and I had to get rid of it. As wireless still didn't work (I'm really assuming it has to do with the connection to my computer from the router being too weak, as I have a crappy router-and-modem-in-one device which was provided by my ISP (Windstream)), I decided I needed another network extender. After lots of research, I set my sights on the PLEK400 which I then purchased along with some generic ethernet cables from Staples. I plugged one into the wall downstairs with an ethernet cable running from it to the router, and plugged another one into the wall close to my PC with an ethernet cable connecting the PL unit to the PC. The connection established, and I was overjoyed that my PC finally had Internet after those few Internet-less weeks. However, after browsing the Internet for a while, I went to open a new tab, and for some reason, I got the error err_network_changed (My browser is Google Chrome). I looked down at the PL unit and all of the lights were dark, none of them lit. After refreshing the error page a few times, it righted itself, the page loaded, and the two lights were flashing with the power one a solid green, like normal. Strange, I thought. However, this problem has begun to occur every 5 to 10 minutes. This would not be an issue, however, I am a gamer, so when I am Skyping my friends and playing online and the call drops and I have to disconnect every 5 - 10 minutes, I become very agitated. vv IMPORTANT? vvOur house is very old, so the entire thing is on the same breaker, so I know it's not that. I've heard that when there is a lot of electrical noise in an outlet (Many things connected to it), that can cause problems, so I'm going to state for the record that the powerstrip on which my entire PC setup operates and my upstairs PL unit are plugged into the same traditional two-plug outlet. (Don't know whether that may be a problem or not.)^^ IMPORTANT? ^^ I would really like to get these working or send them back as the entire setup (PLEK400 and ethernet cables) cost me about $60 - $70, and as a teen, that's a bit of money to me. Fast response is greatly appreciated by anyone who has any solutions to offer. I will be checking this post frequently throughout the night and following days for anyone who has anything to offer. If this is a product limitation and there is no way to fix it, PLEASE JUST TELL ME SO. I prefer to return everything and seek alternate solutions than wait too long for a solution that may never come to the point where I can no longer return anything and I am out $60 - $70. TL;DR: Lights on PL unit go dark, no internet for a minute or two, lights come back on, internet works again. Happens every 5 - 10 minutes. All replys are great, fast ones, especially so. As previously stated, any help is appreciated!!!! Thanks so much in advance, --Edwin

    If you say that all lights go dark (including the power light), it means that the device itself is power cycling which is not a good thing. If it was just the power line light or the ethernet light, it would have been normal since that indicates disconnection, but if it's the power light, that's a different story. Does this only happen if you are using the internet or does it act the same way even on standby?   Press and hold the reset button of the device for 10 seconds using a pen or a paper-clip and powercycle the unit. It will also help isolate the situation if you try a different power source. BTW, have you tried checking if the 1 port PLE switch is acting the same way? 

  • Slow Connection that sometimes drops

    Office: I have Airport Extreme BS, sim. dualband -n connected to a modem thorugh Ethernet. Set to create a wireless network
    Home: In a 40 meters distance from the office I have placed the Time Machine (also the latest model) that backes up the Mac Mini server a work. There is a visual between the AEBS and the TC.
    The TC is set top extend the office wireless network.
    RSSI: -76
    Transmssion rate: 81
    MCS: 4
    The connection does not seem stable. Sometimes the connection drops out, causing the backup to fail.
    Would it do any good to buy an outdoor repeater placing it on the roof of the office building?
    I have another wireless network at home. Could that be intefering with the first one? -And how can that be prevented?

    Hans-Ole wrote:
    RSSI: -76
    On which device do you see that value? It's fairly low and doesn't give you much spread over the probable noise level.
    Launch AirPort Utility. Put the AirPort Extreme into "manual setup" mode. Pull down the "Base Station" menu and select "Logs and Statistics". Select the "Wireless Clients" tab. Note the values for "Signal" and "Noise" for the Time Capsule, perhaps identified as "Wireless Extender". Use this discussion post to evaluate the quality of the connection:
    http://discussions.apple.com/thread.jspa?messageID=10329543&start=1
    Would it do any good to buy an outdoor repeater placing it on the roof of the office building?
    I'm not familiar with those. You might be able to improve the connect by moving or reorienting either or both stations. You might also try using a different channel or band. In the 5 GHz band try channels 149 and up. In the 2.4 GHz band try channels 1, 6, or 11.
    I have another wireless network at home. Could that be interfering with the first one? -And how can that be prevented?
    It could be interfering. One of the "stumbler" utilities could help you investigate that. Switching channels can help avoid interference.

  • Socket.connect

    I'm trying to write a client application that will connect to a server whenever it becomes available. There are some problems which I hope someone will be able to help, Below is a snippet of the code that makes the connection:
    while(alive){
    try{
    /* part 1*/
    Socket s = new Socket();
    s.setReuseAddress(true);
    s.bind(localAddress);
    /* end part 1*/
    s.connect(targetAddress);
    } catch (Exception e){}
    this seems to works fine. However when I place part 1 of the code outside the while loop. the connection will not be made if the server application is up after my connection thread has started running. Isnt Socket.connect suppose to block until a valid connection is made?
    Also when running my application (with the code above) over a long period of time, I get a OutOfMemoryException (native memory) when the server application is not present. Do I have to specify some other parameters for the JVM to release the native resources allocated for a socket construction or is this just a bug? I am running the application using java 1.6 on RHEL4 2.6.9-34.ELSMP.
    Thank you in advance.

    The thread is respawned when then server application
    drops thus yes the socket will only make one
    connection.Not if you move part 1 out of the loop.If you do that you will attempt multiple connections with the socket, which doesn't work.
    Shouldnt the thread block when .connect() fails?Why? Block doing what?
    Instead i'm getting a connection refused exception.What else should it do?
    No i did not close the socket when I get an exception.You should.
    Should the resources be reclaimed since
    the socket object would have gone out of scope?Eventually.
    I'm running my application on a system with multiple
    network cards thus i need to bind it to the intended
    address.Why? TCP/IP will find the best route if you don't get in its way. Why not let it?

  • Java Socket Connection Time out

    Goal*
    I want to check host/port availability of computers in our network (~100 computers) .. Just check if host is alive and if it has port 445 opened. I want to do this somehow in parallel, so the code execution is as quick as possible.
    My implementation*
    I do this by creating socket connection to the host. Something like this:
            Socket s = null;
            try {
                s = new Socket();
                InetSocketAddress socketAddress = new InetSocketAddress(ipAddress, 445);
                s.connect(socketAddress, 3000);
                if (s.isConnected()) {
                    // do something
            } catch (ConnectException ex) {
                //exception thrown
            } catch (IOException ex1) {
                //exception thrown
            } finally {
                try {
                    // close socket
                    s.close();
                } catch (IOException ex) {
                    Logger.getLogger(ComputerModel.class.getName()).log(Level.SEVERE, null, ex);
            }This code is executed in a loop, where a separate thread is created for every iteration = ~100 separate threads.
    Problem:*
    1.
    It seems to me, that first ~10-15 connections are created ok, but then my code reaches 'IOException' catch block for every subsequent itteration and ex.getMessage() returns "connection time out" (I try to use different timeout values in the 2nd parameter. Values from 3000 up to 20000).
    Is it valid to create 100 separate threads in a loop? Can't I make my NIC to bussy with this ??? What is the maximum ammount of threads, I can create? I did not use threads before, so I have no idea, if max values are near to 10, 100, 1000, or 10000 ..
    2.
    After my code is executed, I enter 'netstat -an' command in my command line and I get bunch of connections, which report status of SYN_SENT for several connections.
    TCP 10.20.11.140:4557 10.30.11.119:445 SYN_SENT
    TCP 10.20.11.140:4558 10.30.11.176:445 SYN_SENT
    TCP 10.20.11.140:4559 10.30.11.100:445 SYN_SENT
    TCP 10.20.11.140:4560 10.30.11.142:445 SYN_SENT
    TCP 10.20.11.140:4561 10.30.11.171:445 SYN_SENT
    TCP 10.20.11.140:4562 10.30.11.143:445 SYN_SENT
    TCP 10.20.11.140:4563 10.30.12.12:445 SYN_SENT
    TCP 10.20.11.140:4564 10.30.12.11:445 SYN_SENT
    TCP 10.20.11.140:4565 10.30.12.21:445 SYN_SENT
    TCP 10.20.11.140:4566 10.30.11.150:445 SYN_SENT
    I also feel, that my computer network response (e.g. firefox browsing) is a bit slower ..
    How shall I handle this problem properly?
    Thx in advance,
    Juraj

    kajbj wrote:
    tschodt wrote:
    kajbj wrote:
    The documentation for netstat explains what SYN_SENT is, but
    I don't know why you have them.The app has asked the TCP stack to transmit SYN
    the TCP stack is now waiting for SYN-ACK.
    If there is no host at that IP address or a host that drops connections (SYN packets) for TCP port 445
    there will never be a SYN-ACK.
    After a few minutes the TCP stack will time out the connection attempt.Yes, I was rather commenting on why his hosts aren't answering. I thought that his case was that all of them should answer :)Akkurat. I was answering more for clarification.
    Someone who does not know your posting history could easily assume you meant
    it was a mystery why netstat was showing SYN_SENT.
    And I figured it would not harm to hint that one possible reason would be that those machines are powered off (no host).

Maybe you are looking for

  • Automatic Clearing through FESR

    Dear All, We are using FESR for posting the customer payments and automatic clearing. While it works for the payments which has no difference but for small differencesit it only post the payments but does not create a clearing document. So we have to

  • Client issue with ALE Configurations

    Hi Experts, I am trying to connect to a different SAP System through ALE. I have defined logical systems. When i am trying to assign destination logical system to destination client, i am getting an error -  "Entry already exists" as there is another

  • Drop outs and - [DoS attack: ACK Scan RST Scan, Teardrop attack....]

    Hi all Dropped a little excerpt of my router status log below.Basically the internet keeps dropping out, making streaming a pain in the a##....If anyone could offer advice, suggestions etc, Itd be greatly appreciated.  Our internet was flawless for t

  • What do I need to do to take full advantage of a 802.11ac Airport?

    Do I need to purchase any separate cable? Gigabite ethernet cables? WAN vs Lan cables? Will I need to better Modem? What is the best Modem to get? Will I need to upgrade my standard internet service?

  • Desktop icons go off the screen

    My son was most likely trying to play a game and I am thinking he changed the screen somehow. Now, my screen icons go off the page. My menu bar at the top alos moves so the time, etc., are not fixedin the top right corner. Where do I go to change thi