Check connection via AS400

My method should try to connect to another database server. When I run my application on Linux Server, everything was fine. When I run it on Windows - I have java.net.SocketTimeoutException: Read timed out

  private boolean pingServer(String host) { String username = "username"; String password = "password"; boolean successful; AS400 as400 = new AS400(host, username, password); SocketProperties socketProperties = as400.getSocketProperties(); socketProperties.setLoginTimeout(TIMEOUT_MILLISEC); socketProperties.setSoTimeout(TIMEOUT_MILLISEC); as400.setSocketProperties(socketProperties); try{ successful = as400.validateSignon(); } catch (AS400SecurityException e) { successful = true; } catch (IOException e) { successful = false; } catch (TransactionException e) { successful = false; } as400.disconnectAllServices(); as400 = null; return successful; } 

Can someone give me some advice? Thanks.

+5
source share
1 answer

AS / 400 connections use many network ports that should be available to you.

Try disabling all firewalls between you and the server and try again. This includes the software firewall (may be part of an antivirus package) on Windows

+2
source

Source: https://habr.com/ru/post/1208247/


All Articles