Code example for LocalSocket

Methods: connectgetOutputStream

0
      } 
      // Just closing the server socket does not immediately interrupt accept. 
      // See: https://code.google.com/p/android/issues/detail?id=29939 
      // So instead send a special message to the socket. 
      try { 
        LocalSocket sock = new LocalSocket();
        sock.connect(new LocalSocketAddress(mServerSockName));
        DataOutputStream os = new DataOutputStream(sock.getOutputStream());
        os.writeChar(1);
        os.writeByte('q');
        os.flush();
      } catch (IOException e) {}
      try { 
        mThread.join();
      } catch (InterruptedException e) {}
    } 
 
    @Override 
    public void run() { 
      LocalServerSocket serverSocket = null;
Connect your IDE to all the code out there  Get Codota for Java