Changeset 4 for src/main/java


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

Fixed performance issue with some computers

Location:
src/main/java/geniusweb/runserver
Files:
2 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(
  • src/main/java/geniusweb/runserver/RunNego.java

    r1 r4  
    6666                                RunningNegotiationsRepo.instance(), log);
    6767                RunningNegotiationsRepo.instance().put(session);
     68                // set content type to prevent some browsers
     69                // trying to parse this (eg as XML)
     70                response.setContentType("application/json");
    6871                response.getWriter().append(session.getID());
    6972        }
Note: See TracChangeset for help on using the changeset viewer.