Ignore:
Timestamp:
09/24/19 14:13:26 (5 years ago)
Author:
bart
Message:

Fixed performance issue with some computers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/geniusweb/runserver/PartyConnection.java

    r1 r4  
    3333
    3434/**
    35  * A websocket based {@link ConnectionWithParty}. Must be public so that it can
    36  * be accessed as ClientEndpoint by apache tomcat
     35 * A websocket based {@link ConnectionWithParty}. it contains a websocket
     36 * connection to a party that runs on a runserver. Must be public so that it can
     37 * be accessed as ClientEndpoint by apache tomcat. This is internally used.
    3738 */
    3839@ClientEndpoint
     
    102103                                .openConnection();
    103104                // if this throws, the IOException seems to contain the "retry later"
    104                 // message
    105                 // already
    106                 conn.setRequestMethod("GET"); // TODO timeout
     105                // message already
     106                conn.setRequestMethod("GET");
     107                conn.setReadTimeout(20000);
     108                conn.connect();
    107109                BufferedReader rd;
    108110                try {
     
    110112                                        new InputStreamReader(conn.getInputStream()));
    111113                } catch (IOException e) {
     114                        if (conn.getErrorStream() == null) {
     115                                throw new IOException("Failed to connect " + reference
     116                                                + ", no server error message", e);
     117                        }
    112118                        // read the detail message from the error stream
    113119                        rd = new BufferedReader(
Note: See TracChangeset for help on using the changeset viewer.