YGPS/src/com/mediatek/ygps/ClientSocket.java
private void openClient() {
        Log.v("@M_" + TAG, "enter startClient");
        if (null != mClientSocket && mClientSocket.isConnected()) {
            Log.d("@M_" + TAG, "localSocket has started, return");
            return;
        }
        try {
            mClientSocket = new Socket("127.0.0.1", SERVER_PORT);
            mClientSocket.setSoTimeout(SOCKET_TIME_OUT_TIME);
            mDataOutput = new DataOutputStream(mClientSocket.getOutputStream());
            mDataInput = new DataInputStream(mClientSocket.getInputStream());
        } catch (UnknownHostException e) {
            Log.w("@M_" + TAG, e.getMessage());
        } catch (IOException e) {
            Log.w("@M_" + TAG, e.getMessage());
        }
    }
/**
     * Start client socket and connect with server.
     */
Start client socket and connect with server.
Start client socket and connect with server .
private void openClient() {
        Log.v("@M_" + TAG, "enter startClient");
        if (null != mClientSocket && mClientSocket.isConnected()) {
            Log.d("@M_" + TAG, "localSocket has started, return");
            return;
        }
        try {
            mClientSocket = new Socket("127.0.0.1", SERVER_PORT);
            mClientSocket.setSoTimeout(SOCKET_TIME_OUT_TIME);
            mDataOutput = new DataOutputStream(mClientSocket.getOutputStream());
            mDataInput = new DataInputStream(mClientSocket.getInputStream());
        } catch (UnknownHostException e) {
            Log.w("@M_" + TAG, e.getMessage());
        } catch (IOException e) {
            Log.w("@M_" + TAG, e.getMessage());
        }
    }
private void openClient ( ) { Log . v ( "@M_" + TAG , "enter startClient" ) ; if ( null != mClientSocket && mClientSocket . isConnected ( ) ) { Log . d ( "@M_" + TAG , "localSocket has started, return" ) ; return ; } try { mClientSocket = new Socket ( "127.0.0.1" , SERVER_PORT ) ; mClientSocket . setSoTimeout ( SOCKET_TIME_OUT_TIME ) ; mDataOutput = new DataOutputStream ( mClientSocket . getOutputStream ( ) ) ; mDataInput = new DataInputStream ( mClientSocket . getInputStream ( ) ) ; } catch ( UnknownHostException e ) { Log . w ( "@M_" + TAG , e . getMessage ( ) ) ; } catch ( IOException e ) { Log . w ( "@M_" + TAG , e . getMessage ( ) ) ; } }
Start client socket and connect with server.
Start client socket and connect with server .