@@ -0,0 +1,494 @@
+package com.inmobi.messaging;%0A%0Aimport java.io.IOException;%0Aimport java.net.ServerSocket;%0A%0Apublic class PortNumberUtil %7B%0A%0A  public static int getFreePortNumber(int defaultPortNumber) %7B%0A    int port = defaultPortNumber;%0A    try %7B%0A      ServerSocket socket = new ServerSocket(0);%0A      port = socket.getLocalPort();%0A    %7D catch (IOException e) %7B%0A      System.out.println(%22IOException occured while creating socket.%22%0A          + %22 Use a default port number %22 +  port);%0A    %7D%0A    return port;%0A  %7D%0A%7D%0A

add portNumber util class