Code example for LocalServerSocket

Methods: close

0
    } 
 
    @Override 
    public void tearDown() throws Exception { 
        if (mSocket != null) mSocket.close();
        if (mServerSocket != null) mServerSocket.close();
        super.tearDown(); 
    } 
 
    /** 
     * Sends a message on the netd socket and gives the events some time to make it back. 
     */ 
    private void sendMessage(String message) throws IOException {
        // Strings are null-terminated, so add "\0" at the end. 
        mOutputStream.write((message + "\0").getBytes());
    } 
 
    private static <T> T expectSoon(T mock) {
        return verify(mock, timeout(100));
    }