Code example for LocalSocket

Methods: shutdownInput

0
        Log.d(TAG, "Stopping...");
        mRunning = false;
        if (mSocket != null) {
            try { 
                /* forcably stop socket communication */ 
                mSocket.shutdownInput();
            } catch (IOException e) {
                Log.w(TAG, "I/O error during listener shutdown", e);
            } 
        } 
        mWriteThread.quit();
    } 
 
    public void sendUsbModeSwitchCmd(final String cmd) {
        if (cmd != null) {
            Log.d(TAG, "received usb mode change command from UI: " + cmd);
            mWriteHandler.post(new Runnable() {
                @Override 
                public void run() { 
                    writeCommand(cmd, null);
                }