app/src/main/java/org/sil/hearthis/SyncServer.java
// Method executed in thread when super.start() is called.
Method executed in thread when super.start() is called.
Method executed in thread when super . start () is called .
@Override
    public void run() {
        super.run();
        try {
            ServerSocket serverSocket = new ServerSocket(_serverPort);
            serverSocket.setReuseAddress(true);
            while(_running){
                try {
                    final Socket socket = serverSocket.accept();
                    DefaultHttpServerConnection serverConnection = new DefaultHttpServerConnection();
                    serverConnection.bind(socket, new BasicHttpParams());
                    httpService.handleRequest(serverConnection, httpContext);
                    serverConnection.shutdown();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (HttpException e) {
                    e.printStackTrace();
                }
            }
            serverSocket.close();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
@ Override public void run ( ) { super . run ( ) ; try { ServerSocket serverSocket = new ServerSocket ( _serverPort ) ; serverSocket . setReuseAddress ( true ) ; while ( _running ) { try { final Socket socket = serverSocket . accept ( ) ; DefaultHttpServerConnection serverConnection = new DefaultHttpServerConnection ( ) ; serverConnection . bind ( socket , new BasicHttpParams ( ) ) ; httpService . handleRequest ( serverConnection , httpContext ) ; serverConnection . shutdown ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( HttpException e ) { e . printStackTrace ( ) ; } } serverSocket . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Method executed in thread when super.start() is called.
Method executed in thread when super . start () is called .