Example usage for android.net LocalSocket connect

List of usage examples for android.net LocalSocket connect

Introduction

In this page you can find the example usage for android.net LocalSocket connect.

Prototype

public void connect(LocalSocketAddress endpoint) throws IOException 

Source Link

Document

Connects this socket to an endpoint.

Usage

From source file:com.github.chenxiaolong.dualbootpatcher.socket.MbtoolConnection.java

/**
 * Bind to mbtool socket//  ww w. j  av a 2  s.  com
 *
 * @throws MbtoolException
 */
private static LocalSocket initConnectToSocket() throws MbtoolException {
    try {
        LocalSocket socket = new LocalSocket();
        socket.connect(new LocalSocketAddress(SOCKET_ADDRESS, Namespace.ABSTRACT));
        return socket;
    } catch (IOException e) {
        Log.e(TAG, "Could not connect to mbtool socket", e);
        throw new MbtoolException(Reason.DAEMON_NOT_RUNNING, e);
    }
}