ciao ho un server ftp fatto in java attivo 24h/24 ma ogni tanto, in modo inconcepibile, si blocca tutto..
se cerco di stabilire delle connessioni mi viene restituito "Connection reset"
eppure mi sembra tutto giusto.. questa la run dell'applicazione server..
codice:public void run(){ Socket socket; // IMPOSTO INDIRIZZO IP DI DEFAULT String indirizzoIP = ""; try{ // LETTURA DA FILE DI CONFIGURAZIONE DELL'INDIRIZZO IP (se vuoto utilizzo quello locale) indirizzoIP = Conf.getNodeValue("Server.ip"); if (indirizzoIP.equals("")){ indirizzoIP = java.net.InetAddress.getLocalHost().getHostAddress(); } ss = new ServerSocket(Conf.getServerPort(),100, InetAddress.getByName(indirizzoIP)); obsServerStarted(true); while(true){ try { Thread.currentThread().sleep(1000); } catch (Exception ex) {} socket = ss.accept(); if (!Conf.isBanned(socket) && probes.size() < maxConnections) { // CONTROLLO LIMITE SESSIONE if (sessionNr >= Integer.MAX_VALUE){ sessionNr = 0; } // INCREMENTO IL NUMERO DI SESSIONE sessionNr = sessionNr+1; Probe p = new Probe(socket, this, sessionNr); probes.add(p); obsClientConnected(p.ses.us); p.start(); }else { socket.close(); } } }catch(SocketException se) { bb.dockException(se,""); if (!suspended){ obsServerStarted(false); //server could not be started // SERVER NON AVVIATO arrestaProgramma(indirizzoIP, Conf.getServerPort() ); } }catch(IOException e){ bb.dockException(e,""); } catch (Exception e) { bb.dockException(e,""); // SERVER NON AVVIATO if(indirizzoIP.equals("")){ indirizzoIP = "unknown"; } arrestaProgramma(indirizzoIP, Conf.getServerPort() ); } if(suspended) obsServerStoped(); }


Rispondi quotando