JAVA Socket Accept hangs

Below code hangs does not go past beyond below messages and is hanging at socket.accept(). Its part of an android app and INTERNET permissions are already added to manifest. Tried putting accept in while(true) loop...but that did not work:

09-23 15:55:43.737 24079-25436: Trying to open port 5556... 09-23 15:55:43.739 24079-25436: >>> Opening Port : 5556

    private Socket socket = null;
    private ServerSocket server = null;

    private static final String TAG = "MyActivity";


    public boolean openPort(String host , int port){

        try {
            server = new ServerSocket(port);
        } catch (IOException e) {
            Log.e(TAG , "Error initializing serverSocket: " , e);
        }

        Log.e(TAG , ">>> Opening Port : " + port);

        boolean bmsg = false;

        try {
                socket = server.accept();
                Log.e(TAG , ">>> Opened Port : " + port);

                return true;
        } catch(IOException e){
            Log.e(TAG, "Error opening port: ", e);
            return bmsg;
        } catch(SecurityException s){
            Log.e(TAG, "sError opening port: ", s);
            return bmsg;

        } catch(IllegalBlockingModeException b){
            Log.e(TAG, "bError opening port: ", b);
            return bmsg;
        }
    }

Above class is being called from below async task on button click:

private class openPort extends AsyncTask{

    @Override
    protected Object doInBackground(Object[] objects) {
        Log.i(TAG , "Trying to open port 5556...");
        //host is localhost
        //port is 5556
        OpenClosePort ocp = new OpenClosePort();
        ocp.openPort(host , port);

        return null;
    }
}