RMI Controlling the Ports

How can i control the ports through firewall
please help me by seeing the client and server class
Server Class
package common.server;
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.*;
import java.util.*;
import common.biz.user.*;
import common.message.*;
import common.resource.*;
import common.util.*;
import common.setup.*;
import common.service.*;
//import common.server.*;
import common.database.*;
import common.partner.*;
import common.comms.*;
import common.exception.*;
import common.message.*;
import corpln.utilclass.*;
import custiden.biz.*;
import logon.util.*;
import logon.gui.*;
public class MulticastServerImpl extends UnicastRemoteObject
     implements SvcMulticastServerIntf {
     Variables
     private boolean checkLogon = true;
     protected Environment environment;
     private SysComponentID serverComponentID;
     protected StdServerServices stdServerServices;
     protected DBResourceMgr dbResourceMgr; // database resources management e.g. DB connection management
     protected CommsMgr commsMgr ; // communications management
     protected ServerPartnerMgrIntf serverPartnerMgr; // manages list of partners with whom server communicates
     //protected Environment environment;
     private ErrMsg errMsg ;
     private static String SERVER_STARTUP_ERR_MSG_K =" Unable To start up server ";
     private static String CANNOT_LOCATE_REGISTRY_MSG_K =" Cannot locate registry";
     private ClientMonitor clientMonitor = null;
     protected CheckPassword checkPassword = null;
     protected AccessProfile accessProfile = null; // object to check access to trans from sec server
     private ParaTab _ParaTab      = null;
     int port=0;
     Constants
     private static int MAX_NO_OF_CLIENTS = 100;
     private int curMaxNoOfClients = 0;
     private static String UNABLE_TO_CONNECT_MSG_K = "Unable to Connect to ";
     private static String MAX_CLIENT_EXCEEDED_MSG_K = "Maximum number of users exceeded:";
     private static String UNABLE_TO_DISCONNECT_MSG_K = "Unable to disconnect";
CustomRMIFactory mysoc;
     Constructors
     //not in use
     public MulticastServerImpl () throws RemoteException {} ;
     //not in use
     public MulticastServerImpl (String parameterFileName, SysComponentID _serverComponentID) throws RemoteException {
          serverComponentID = _serverComponentID;           
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,MAX_NO_OF_CLIENTS,true); //inits default server settings
          if (retnCd.isError()) {
               System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName()+ retnCd.getMsg());
               System.exit(0);}
     //Other servers that requires MQ e.g. CustProfileServerImpl
     public MulticastServerImpl (String parameterFileName,SysComponentID serverComponentID, int curMaxNoOfClients) throws RemoteException {
          serverComponentID = _serverComponentID;
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,_curMaxNoOfClients, true);
          if (retnCd.isError()){
          System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName() + retnCd.getMsg());
               System.exit(0);
     //PrintServerImpl
     public MulticastServerImpl (String parameterFileName,SysComponentID serverComponentID, int curMaxNoOfClients, boolean initMQ) throws RemoteException {
          serverComponentID = _serverComponentID;
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,_curMaxNoOfClients, initMQ);
          if (retnCd.isError()){
          System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName() + retnCd.getMsg());
               System.exit(0);
     private RetnCd initServer(String parameterFileName, SysComponentID serverComponentID, int curMaxNoOfClients, boolean initMQ){
          if (parameterFileName.equals("")) {
               printConsoleMsg("Parameter file name not supplied. Server cannot be started");
          printConsoleMsg("Starting server");
          BillUtilities.setOutputToFile(_serverComponentID.getSysName());
          RetnCd retnCd = new RetnCd();
          _ParaTab = new ParaTab();
          try {
          //Environment.setProcStatusDate(new Date()); // to get from file
          Environment.setProcStatusDate(BillUtilities.convertStrToDate(_ParaTab.getProcStatusDate()));
          printConsoleMsg("Current logical date :"+ Environment.getProcStatusDate());
          stdServerServices = new StdServerServices(_serverComponentID,
               _curMaxNoOfClients, initMQ);
          } catch (ServerStartupEx ex){
               retnCd.setError(ex);
               System.out.println(retnCd.getMsg());
               return retnCd;
} catch (Exception e){
               retnCd.setError(e);
               System.out.println(retnCd.getMsg());
               return retnCd;
          } //catch
     dbResourceMgr = stdServerServices.getDBResourceMgr();
     printConsoleMsg("Database resource manager started");
     //check for MQ initialization
     if(initMQ)
     commsMgr = stdServerServices.getCommsMgr();
     printConsoleMsg("Communications resource manager started");
     serverPartnerMgr = stdServerServices.getPartnerMgr();
     //environment = new Environment();
     clientMonitor = new ClientMonitor(serverPartnerMgr);
     Environment.setOrgCd(Environment.getPara(ConfigResrcek.ORG_CD_K));
     clientMonitor.start();// start monitor to track number of logon clients
     printConsoleMsg("Client monitor started");
printConsoleMsg("Attaching to security server");     
     retnCd = attachSecurityServer();
     printConsoleMsg(retnCd.getMsg());
     String xcheckLogon = Environment.getPara(ConfigResrcek.CHECK_LOGON_AT_SERVER_K);
     System.out.println(xcheckLogon);
     if (xcheckLogon.equals("false") )
          checkLogon = false;
     else
          checkLogon = true;
     printConsoleMsg("Logon is "+ checkLogon);
          return retnCd;
     }// initServer
     // manages list of partners with whom server communicates System.out.println("Server " + serverComponentID.getSysName()+ " started with " + curMaxNoOfClients + " clients" + environment.getSysDate().toString() );
     Common Server Methods implemented
// connection from client
// retnCd contains the client's PartnerToken session object
     public final RetnCd connect(ServerPartnerImpl _newServerPartner) throws RemoteException{
          printConsoleMsg("New Client detected ");
          RetnCd retnCd = new RetnCd();
          retnCd = checkValidToken( (PartnerTokenImpl)_newServerPartner );
          if (retnCd.isSuccess()){
          PartnerTokenImpl clientToken = new PartnerTokenImpl();
          String partnerID = "";
          // request partner manager to add
          try{
          retnCd = serverPartnerMgr.addPartner(_newServerPartner); // add new connection as partner
          if (retnCd.isSuccess()){
               partnerID = ((String)retnCd.getObj()); // client's partner ID assigned by the server
          clientToken.setLogonProcDateTimeAtServer(Environment.getProcStatusDate());
          clientToken.setLogonSysDateTimeAtServer(Environment.getSysDate()); //set server logon date and time
          clientToken.setClientIDAtServer(partnerID); //set client partner ID assigned by server
          clientToken.setServerSysComponentID(serverComponentID); //set server ID in component
          _newServerPartner.getClientCallback().dispMsg("Connected as "+partnerID + " to "+ getServerName());
          retnCd.setObj(clientToken);
          } catch (TablFullException tex){
               retnCd.setError(tex);
               retnCd.setMsg(UNABLE_TO_CONNECT_MSG_K + getServerName() MAX_CLIENT_EXCEEDED_MSG_K
                    tex.getMaxUsers() );
               return retnCd;
          }//tablFullException
          catch (Exception ex){
               retnCd.setError(ex);
               retnCd.setMsg(UNABLE_TO_CONNECT_MSG_K + getServerName());
               return retnCd;
          } // exception
          } // retncd.isSuccess()
          printConsoleMsg(retnCd.getMsg());
          return (retnCd);
     public final RetnCd disconnect(PartnerTokenImpl _partnerToken) throws RemoteException {
          RetnCd retnCd = new RetnCd();
          try {
retnCd = serverPartnerMgr.removePartner(_partnerToken); // request partner manager to remove partner
          } catch (ObjNotFound ex){
               retnCd.setError(ex);
               retnCd.setMsg(UNABLE_TO_DISCONNECT_MSG_K);
          } //catch
          return retnCd;
     } // disconnect
public final RetnCd isServerActive() throws RemoteException{
     RetnCd retnCd = new RetnCd();
     retnCd.setSuccess();
     return retnCd;
public final RetnCd shutDown() throws RemoteException{
     RetnCd retnCd = new RetnCd();
     System.out.println("MulticastServerImpl about to shutdown...");
     broadcastMsg("SERVER IS SHUTTING DOWN ........NOW");
     System.exit(0);
     retnCd.setSuccess();
     return retnCd;
public final RetnCd prepareShutDown(int minutes) throws RemoteException{
     RetnCd retnCd = new RetnCd();
     broadcastMsg("SERVER IS SHUTTING DOWN ........IN "+minutes + " MINUTES");
     retnCd.setSuccess();
     return retnCd;
private final void broadcastMsg(String msg) throws RemoteException{
          int x = 0;
          int numOfClient = 0;
          RetnCd retnCd ;
          StdTbl copyOfPartnerList = null;
          String partnerID;
          do{
          copyOfPartnerList = serverPartnerMgr.getPartnerListSnapshot();
          numOfClient = copyOfPartnerList.size();
          if ((numOfClient)>0){
               copyOfPartnerList.goTop();
               while (!copyOfPartnerList.isEOTbl()) {
                    try{
                    ServerPartnerImpl partner = ((ServerPartnerImpl)
                         (copyOfPartnerList.getCurrent()));
                    partnerID = partner.getClientPartnerID();
               retnCd = sendMsg(partner,msg);
                    } catch (Exception ex){ex.printStackTrace(); break;};
               copyOfPartnerList.skip();
               } //while
               copyOfPartnerList.endSeqProc();
               //completed sending
               break;               
          } //if
          else break;
          } while (true); //endless loop until interrupted
     }//broadcastMsg
public final void sendMsgToClient(StdTbl usrList, String msg) throws RemoteException{
          usrList.goTop();
     while (!usrList.isEOTbl()) {
          try{
               String usr = (String)usrList.getCurrent();
          sendMsgToClient(usr,msg);
} catch (Exception ex){ex.printStackTrace(); break;};
               usrList.skip();
          } //while
          usrList.endSeqProc();
          //completed sending
private final void sendMsgToClient(String usr, String msg) throws RemoteException{
          int x = 0;
          int numOfClient = 0;
          RetnCd retnCd ;
          StdTbl copyOfPartnerList = null;
          String partnerID;
          do{
               copyOfPartnerList = serverPartnerMgr.getPartnerListSnapshot();
          numOfClient = copyOfPartnerList.size();
          if ((numOfClient)>0){
          copyOfPartnerList.goTop();
          while (!copyOfPartnerList.isEOTbl()) {
               try{
          ServerPartnerImpl partner = ((ServerPartnerImpl)
               (copyOfPartnerList.getCurrent()));
               //send for specific user
               if(!partner.getClientSysComponentID().isSysClient()) {
               if(((partner.getUser()).getLogonID()).equals(usr)){
                    partnerID = partner.getClientPartnerID();
               retnCd = sendMsg(partner,msg);
               }// end check that it is not a system client
          } catch (Exception ex){ex.printStackTrace(); break;};
          copyOfPartnerList.skip();
          } //while
          copyOfPartnerList.endSeqProc();
          //completed sending
          break;               
          } //if
          else break;
          } while (true); //endless loop until interrupted
     }//broadcastMsg
     private RetnCd sendMsg(ServerPartnerImpl _partner, String msg){
          RetnCd retnCd = new RetnCd();
          //send msg to application clients only
          if(!_partner.getClientSysComponentID().isSysClient()) {
          try {
               System.out.print("Send Msg to " + _partner.getClientPartnerID());
          retnCd = _partner.getClientCallback().isClientUp();
          System.out.println("is active");
partner.getClientCallback().dispMsg("Client:"+partner.getClientPartnerID()+" Message from Server:"+ serverPartnerMgr.getServerName() +" " +(new Date()).toString() + " "+msg);
          catch (Exception ex) {
               System.out.println("is not active");
          retnCd.setError(ex);
          return retnCd;
     } //pollActiveClient
     public final String getServerName() throws RemoteException{ return serverComponentID.getSysName();}     
public final Date getProcDate() throws RemoteException {
     return Environment.getProcStatusDate();
public final Date getSysDate() throws RemoteException {
     return Environment.getSysDate();
     Supporting / utility methods for server setup
protected final RetnCd rebindServer(SysComponentID serverComponentID,Remote _server){
     RetnCd retnCd = new RetnCd();
     try {
               //if (port==0)
               //     port=5000;
          //     if (port==5099)
          //          System.out.println("Users exceeded");
          //     }else
          //     port=port+1;     
          //     mysoc = new CustomRMIFactory ("localhost",port);
          //     System.out.println("PORT" +port);
          //     RMISocketFactory.setSocketFactory(mysoc);
     String RMIURL = Environment.getPara(ConfigResrcek.RMI_REGISTRY_CONF_K);
     Registry r = LocateRegistry.getRegistry(RMIURL);
          // Registry r = LocateRegistry.createRegistry(port,mysoc,mysoc);
     printConsoleMsg("Registry located at "+ RMIURL);
          //_server=new Remote(mysoc);
     //     UnicastRemoteObject.exportObject(_server,0,mysoc,mysoc);
     String componentName = serverComponentID.getSysName();
     r.rebind(componentName, _server);
     printConsoleMsg("Server Bound: " + componentName);
     String[] serverList = r.list();
     printServerList(serverList);
     retnCd.setSuccess();
     }catch (RemoteException rex){
          rex.printStackTrace();
          retnCd.setError(rex);
     }//RemoteException
     catch (Exception ex){
          ex.printStackTrace();
          retnCd.setError(ex);
     }//Exception
     return retnCd;
} //rebindServer     
     protected void printHeader(String msg){
     printConsoleMsg("########################################################################");
     printConsoleMsg(msg);
printConsoleMsg("########################################################################");
     protected void printHeader(String msg,RetnCdSQL ret){
     printConsoleMsg("########################################################################");
     printConsoleMsg(msg);
printConsoleMsg("########################################################################");
System.out.println(ret.isSuccess());
     protected void printConsoleMsg(String msg){
     String dateStr = new Date().toString();
     System.out.println(dateStr + serverComponentID.getSysName()+" --> " + msg);
     private void printServerList (String [] _serverList){
          System.out.println("List of objects in RMI Reg");
          for (int x = 0; x< _serverList.length; x++){
               System.out.println(_serverList[x]);
          } //for
private boolean isCheckLogon(){ return checkLogon;}
     private RetnCd attachSecurityServer(){
     checkPassword = new CheckPassword("",""); // no user id, password reqd as need to init object only, pwd reqd for initial connection
RetnCd retnCd = checkPassword.connectToServer(); // connect to security server
     System.out.println("From MulticastServerImple" +retnCd);
     return retnCd; // connect to server
     protected synchronized RetnCd checkValidToken(PartnerTokenImpl partnerToken){
          // calls the security server to check if valid profile
          RetnCd retnCd = new RetnCd();
          if (isCheckLogon() && !partnerToken.getClientSysComponentID().isSysClient()){
          printConsoleMsg("Checking access for "+ partnerToken.getClientSysComponentID ().getSubComponentID() +" for "+ partnerToken.getUser().getLogonID());
          //RetnCd retnCd = accessProfile.checkAccess(partnerToken.getUser(),
          //     partnerToken.getClientSysComponentID ().getSubComponentID());
          retnCd =partnerToken.getUser().isValid();
if (retnCd.isSuccess()){
     AccessProfile accessProfile = new AccessProfile(checkPassword.getAccessCSoc()); // this is the handle for security server access
retnCd = accessProfile.checkAccess(checkPassword.getAccessCSoc(), partnerToken.getUser(),partnerToken.getClientSysComponentID ().getSubComponentID() );
          } else {retnCd.setSuccess();retnCd.setMsg("Logon check is disabled");}
          printConsoleMsg(retnCd.getMsg());
          return retnCd;
/* methods defined in SvcUnicastServerIntf but need not be implemented here */
public RetnCd retrCustIden(CustIden _CustIden)  throws RemoteException{ return null;}
public RetnCd print (ArrayList list, PartnerTokenImpl partnerToken)
     throws RemoteException{ return null;}
}//end-MulticastServerImpl
Client class
// Class : MulticastServerImpl.java
package common.server;
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.*;
import java.util.*;
import common.biz.user.*;
import common.message.*;
import common.resource.*;
import common.util.*;
import common.setup.*;
import common.service.*;
//import common.server.*;
import common.database.*;
import common.partner.*;
import common.comms.*;
import common.exception.*;
import common.message.*;
import corpln.utilclass.*;
import custiden.biz.*;
import logon.util.*;
import logon.gui.*;
public class MulticastServerImpl extends UnicastRemoteObject
     implements SvcMulticastServerIntf {
     Variables
     private boolean checkLogon = true;
     protected Environment environment;
     private SysComponentID serverComponentID;
     protected StdServerServices stdServerServices;
     protected DBResourceMgr dbResourceMgr; // database resources management e.g. DB connection management
     protected CommsMgr commsMgr ; // communications management
     protected ServerPartnerMgrIntf serverPartnerMgr; // manages list of partners with whom server communicates
     //protected Environment environment;
     private ErrMsg errMsg ;
     private static String SERVER_STARTUP_ERR_MSG_K =" Unable To start up server ";
     private static String CANNOT_LOCATE_REGISTRY_MSG_K =" Cannot locate registry";
     private ClientMonitor clientMonitor = null;
     protected CheckPassword checkPassword = null;
     protected AccessProfile accessProfile = null; // object to check access to trans from sec server
     private ParaTab _ParaTab      = null;
     int port=0;
     Constants
     private static int MAX_NO_OF_CLIENTS = 100;
     private int curMaxNoOfClients = 0;
     private static String UNABLE_TO_CONNECT_MSG_K = "Unable to Connect to ";
     private static String MAX_CLIENT_EXCEEDED_MSG_K = "Maximum number of users exceeded:";
     private static String UNABLE_TO_DISCONNECT_MSG_K = "Unable to disconnect";
CustomRMIFactory mysoc;
     Constructors
     //not in use
     public MulticastServerImpl () throws RemoteException {} ;
     //not in use
     public MulticastServerImpl (String parameterFileName, SysComponentID _serverComponentID) throws RemoteException {
          serverComponentID = _serverComponentID;           
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,MAX_NO_OF_CLIENTS,true); //inits default server settings
          if (retnCd.isError()) {
               System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName()+ retnCd.getMsg());
               System.exit(0);}
     //Other servers that requires MQ e.g. CustProfileServerImpl
     public MulticastServerImpl (String parameterFileName,SysComponentID serverComponentID, int curMaxNoOfClients) throws RemoteException {
          serverComponentID = _serverComponentID;
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,_curMaxNoOfClients, true);
          if (retnCd.isError()){
          System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName() + retnCd.getMsg());
               System.exit(0);
     //PrintServerImpl
     public MulticastServerImpl (String parameterFileName,SysComponentID serverComponentID, int curMaxNoOfClients, boolean initMQ) throws RemoteException {
          serverComponentID = _serverComponentID;
          RetnCd retnCd = initServer(parameterFileName,_serverComponentID,_curMaxNoOfClients, initMQ);
          if (retnCd.isError()){
          System.out.println(SERVER_STARTUP_ERR_MSG_K + " "+ _serverComponentID.getSysName() + retnCd.getMsg());
               System.exit(0);
     private RetnCd initServer(String parameterFileName, SysComponentID serverComponentID, int curMaxNoOfClients, boolean initMQ){
          if (parameterFileName.equals("")) {
               printConsoleMsg("Parameter file name not supplied. Server cannot be started");
          printConsoleMsg("Starting server");
          BillUtilities.setOutputToFile(_serverComponentID.getSysName());
          RetnCd retnCd = new RetnCd();
          _ParaTab = new ParaTab();
          try {
          //Environment.setProcStatusDate(new Date()); // to get from file
          Environment.setProcStatusDate(BillUtilities.convertStrToDate(_ParaTab.getProcStatusDate()));
          printConsoleMsg("Current logical date :"+ Environment.getProcStatusDate());
          stdServerServices = new StdServerServices(_serverComponentID,
               _curMaxNoOfClients, initMQ);
          } catch (ServerStartupEx ex){
               retnCd.setError(ex);
               System.out.println(retnCd.getMsg());
               return retnCd;
} catch (Exception e){
               retnCd.setError(e);
               System.out.println(retnCd.getMsg());
               return retnCd;
          } //catch
     dbResourceMgr = stdServerServices.getDBResourceMgr();
     printConsoleMsg("Database resource manager started");
     //check for MQ initialization
     if(initMQ)
     commsMgr = stdServerServices.getCommsMgr();
     printConsoleMsg("Communications resource manager started");
     serverPartnerMgr = stdServerServices.getPartnerMgr();
     //environment = new Environment();
     clientMonitor = new ClientMonitor(serverPartnerMgr);
     Environment.setOrgCd(Environment.getPara(ConfigResrcek.ORG_CD_K));
     clientMonitor.start();// start monitor to track number of logon clients
     printConsoleMsg("Client monitor started");
printConsoleMsg("Attaching to security server");     
     retnCd = attachSecurityServer();
     printConsoleMsg(retnCd.getMsg());
     String xcheckLogon = Environment.getPara(ConfigResrcek.CHECK_LOGON_AT_SERVER_K);
     System.out.println(xcheckLogon);
     if (xcheckLogon.equals("false") )
          checkLogon = false;
     else
          checkLogon = true;
     printConsoleMsg("Logon is "+ checkLogon);
          return retnCd;
     }// initServer
     // manages list of partners with whom server communicates System.out.println("Server " + serverComponentID.getSysName()+ " started with " + curMaxNoOfClients + " clients" + environment.getSysDate().toString() );
     Common Server Methods implemented
// connection from client
// retnCd contains the client's PartnerToken session object
     public final RetnCd connect(ServerPartnerImpl _newServerPartner) throws RemoteException{
          printConsoleMsg("New Client detected ");
          RetnCd retnCd = new RetnCd();
          retnCd = checkValidToken( (PartnerTokenImpl)_newServerPartner );
          if (retnCd.isSuccess()){
          PartnerTokenImpl clientToken = new PartnerTokenImpl();
          String partnerID = "";
          // request partner manager to add
          try{
          retnCd = serverPartnerMgr.addPartner(_newServerPartner); // add new connection as partner
          if (retnCd.isSuccess()){
               partnerID = ((String)retnCd.getObj()); // client's partner ID assigned by the server
          clientToken.setLogonProcDateTimeAtServer(Environment.getProcStatusDate());
          clientToken.setLogonSysDateTimeAtServer(Environment.getSysDate()); //set server logon date and time
          clientToken.setClientIDAtServer(partnerID); //set client partner ID assigned by server
          clientToken.setServerSysComponentID(serverComponentID); //set server ID in component
          _newServerPartner.getClientCallback().dispMsg("Connected as "+partnerID + " to "+ getServerName());
          retnCd.setObj(clientToken);
          } catch (TablFullException tex){
               retnCd.setError(tex);
               retnCd.setMsg(UNABLE_TO_CONNECT_MSG_K + getServerName() MAX_CLIENT_EXCEEDED_MSG_K
                    tex.getMaxUsers() );
               return retnCd;
          }//tablFullException
          catch (Exception ex){
               retnCd.setError(ex);
               retnCd.setMsg(UNABLE_TO_CONNECT_MSG_K + getServerName());
               return retnCd;
          } // exception
          } // retncd.isSuccess()
          printConsoleMsg(retnCd.getMsg());
          return (retnCd);
     public final RetnCd disconnect(PartnerTokenImpl _partnerToken) throws RemoteException {
          RetnCd retnCd = new RetnCd();
          try {
retnCd = serverPartnerMgr.removePartner(_partnerToken); // request partner manager to remove partner
          } catch (ObjNotFound ex){
               retnCd.setError(ex);
               retnCd.setMsg(UNABLE_TO_DISCONNECT_MSG_K);
          } //catch
          return retnCd;
     } // disconnect
public final RetnCd isServerActive() throws RemoteException{
     RetnCd retnCd = new RetnCd();
     retnCd.setSuccess();
     return retnCd;
public final RetnCd shutDown() throws RemoteException{
     RetnCd retnCd = new RetnCd();
     System.out.println("MulticastServerImpl about to shutdown...");
     broadcastMsg("SERVER IS SHUTTING DOWN ........NOW");
     System.exit(0);
     retnCd.setSuccess();
     return retnCd;
public final RetnCd prepareShutDown(int minutes) throws RemoteException{
     RetnCd retnCd = new RetnCd();
     broadcastMsg("SERVER IS SHUTTING DOWN ........IN "+minutes + " MINUTES");
     retnCd.setSuccess();
     return retnCd;
private final void broadcastMsg(String msg) throws RemoteException{
          int x = 0;
          int numOfClient = 0;
          RetnCd retnCd ;
          StdTbl copyOfPartnerList = null;
          String partnerID;
          do{
          copyOfPartnerList = serverPartnerM

Hi,
for firewall problems search this forum with keyword
firewall.
This thread seems to me very instructive:
http://forum.java.sun.com/thread.jsp?forum=58&thread=151971
Furthermore, search the forum with multihomed or multi-homed keywords, or even port.
For port and interface control, this thread should be
useful:
http://forum.java.sun.com/thread.jsp?forum=58&thread=157864
One solution is a custom socket factory.
Btw, these are really FAQs ...
Have fun,
Klaus

Similar Messages

  • How can I with LabVIEW programatically control the RS-422 port?

    I would like to talk to my hardware through the RS-422 protocal, how would I do this in LabVIEW?
    Thanks alot for ANY help.
    Brian

    Most likely the communication would be identical to what you do for RS-232, only you would use the port number associated with your serial hardware. Thus you can use VISA starting with the serial examples in LabVIEW.
    There are a few extra things like the transceiver control on NI-Serial RS-485 hardware that have special VISA calls, but those are easy to add.

  • Choosing the port of an RMI server

    I need a server working on a port wich is differet from the default 1099, e.g. 2500.
    I create my server object which extends UnicastRemoteObject with code like this
    public MyServer(int port)
    super(port);
    Befor starting the server I run rmiregistry 2500 and the I pass the port number to the server by command line.
    It seems all right to me but I get the same an error message.
    What's wrong?
    Thanks in advance for answers

    I' m sorry. I'm new to RMI and I wrote a Chess Playing RMI software for university. I have managed to make it work on the default port but I don't know how to "escape" from 1099.
    I surfed the Internet for tutorials or code samples but they simply say: "To create an RMI server on the default port 1099 write code like this..." and I can't find the way of changing the port anywhere.
    I didn't write the exact error messaage, and I apologize for that, but it's because I did many trials and often the message changed. It's enough that someone tells me how I have to look to learn the exact way of programming an RMI server on a chosen port.
    Thanks

  • Is it possible to control the parallel port with Lookout 5.0

    I want a simple demo setup on a PC, so I can control the 8 data bits of the parallel port. Example, to use START p/b that would toggle bit 0 and data returned on bit 1.

    It is possible to send bytes to the parallel port using the ASCII object within Lookout. However, it is presently not possible to control the state of the individual bits on the parallel port with Lookout.
    If you need to control the individual bits on a parallel port, consider using LabVIEW. It is much more powerful when programming serial and parallel ports.

  • Please let me know how to control the PID of 5223 port on iMac.

    So many hackers having iP address  the following :
    17.172.232.132 (5223) dated 2013-04-10at 9.57.59 PM
    17.172.233.130 (5223) dated 2013-04-15 at 9.49.10 PM
    17.149.32.21 (5223) dated 2013-04-16 at 04:18:55 PM
    17.149.36.143 (5223) dated 2013-04-16 at 11:31:02 PM
    17.254.32.16 (5223) dated 2013-04-18 at 10.47.43 AM
    17.172.232.145 (5223) dated 2013-04-19 at 11:23:03 AM
    17.172.232.155 (5223) dated 2013-04-19 at 11:44:07 AM
    They had connected to my System(PC) and had interrupted my work. It's crime.
    I already had set a Firmware password and had set admin password, all of my System Preferences also.
    Especially 17.254.32.16 had hacked my system unplugging ethernet cable situation. Very serious~!
    So, I would like to control 5223 port and to quit the process when i want.
    What is the name of the PID of 5223 port?

    "socketfilterfw" process is the Mac OS X Leopard "Application Firewall" or, more technically, the "Socket Firewall".
    "socketfilterfw" process is  automatically work over Mac OS X v 10.7.4, Even thogh i quit the process "socketfilterfw"
    That is to protect system against hacker attack....Just for a moment.
    Please refer to the process.

  • What parameter control the HTTP port at SMICM?

    We need to adjust the HTTP port at SMICM.
    Currently it is wrong.
    We compare 2 systems by running RSPARAM but cannot tell
    which parameter control the HTTP port.
    Please help. Thanks a lot!

    Hi Jennifer,
    Please check the address, below;
    http://help.sap.com/saphelp_nw70/helpdata/EN/61/f5183a3bef2669e10000000a114084/frameset.htm
    "icm/server_port_<xx>" parameter indicates the HTTP port #.
    Best regards,

  • How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    unless i'm missing something, i think you got mixed up, this is easy google for walk throughs
    i'm assuming this is the new 3tb tc AC or 'tower' shape, if so, its wifi will run circles around your at&t device
    unplug the at&t box for a minute and plug it back in
    factory reset your tc - unplug it, hold down reset and keep holding while you plug it back in - only release reset when amber light flashes in 10-20s
    connect the tc to your at&t box via eth in the wan port, wait 1 minute, open airport utility look in 'other wifi devices' to setup the tc
    create a new wifi network (give it a different name than your at&t one) and put the tc in bridge mode (it may do this automatically for you, but you should double check) under the 'network' tab
    login to your at&t router and disable wifi on it
    add new clients to the new wifi network, and point your Macs to the time machine for backups

  • Control parallel port (data and control lines)

    I need to control the output on the parallel port (LPT1) - Both data and control lines.  Once the data is written (Pins2-9), I then need to toggle the Sprocket signal (PIN1) - on the parallel port. The sprocket signal is also referred to as the Data Strobe Output.
    The required method is as follows:
    1. Lower the sprocket signal on PIN1
    2. Send the data (Pins2-9) and wait
    3. Raise the sprocket signal and wait.
    4. Repeat.
    I am looking for a method to control the data on LPT1 pins 2-9 and then be able to toggle PIN1 - Strobe signal - without the data falling from the other pins. What I have found is that whenever the state is changed on the strobe - the data that was written to Pin2-9 falls to zero. This will not work for my application - the strobe tells the hardware device that the data is ready. If it falls to zero when I toggle the strobe - that will not work.
    Regards,
    Guy

    Hello Adam,
    I am familiar with both references.  If you look more closely at the library reference - it allows me to communicate using VISA across the parallel port pins 2-9.  It does not permit direct communication to pin1 (the strobe signal) - property nodes don't allow the strobe to be refereced either (similar to control lines/signals for COM ports).
    Worse, I have also located examples using OUT PORT that does enable pin1 to be toggled.  The problem is, when those VIs are used, the data falls from the data pins when the strobe signal is written, even if its value is not changed.  For example, if the strobe is already high, if another high value is passed, the data falls from the data lines.  The other issue, when using VISA, as soon as the data is writen, the strobe signal automatically goes high even though I need a wait before setting the strobe high.  This is in complete contradiction to the second article you referenced which clearly discusses writing data to pins2-9 then taking the strobe high to indicate to the printer that new data is available.  It must be possible since this is the typical handshake.
    I am still looking for a more complete answer/solution.
    Regards,
    Guy

  • How do I identify the ports to open on my cisco router from Rogers to allow access through my apple tv - I am not using wireless!

    I only have spotty access at best through m Apple TV to itunes, netflix and utube.  I am  Rogers subscriber (feel my pain) and am now using their CISCO DCP3825 router.  Apple TV purchased this past Christmas.  I am not using wireless. No issues prior to replacing my old router and Rogers modem to go to DCP3825.
    Apple TV is up to date - updated by connecting to my Macbook Pro.
    Rogers tech support was of no help - suggested I open some ports - where do I go for the list(s)?
    Any help would be much approeciated.

    did this search for you
    https://www.google.dk/search?client=opera&q=control+open+ports+on+cisco+router&s ourceid=opera&ie=utf-8&oe=utf-8&channel=suggest#client=opera&hs=N7P&channel=sugg est&sclient=psy-ab&q=+open+ports+on+cisco+router&oq=+open+ports+on+cisco+router& gs_l=serp.3..0i7l3.16726.16726.0.16996.1.1.0.0.0.0.49.49.1.1.0...0.0...1c.1.9.ps y-ab.olPaFzjSlmE&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.45175338,d.bGE&fp=43d9a4347 e8aaeda&biw=1535&bih=773
    this may be of intrest
    http://www.tek-tips.com/viewthread.cfm?qid=1163449

  • Is there a way to control the number of concurrent SMTP connections on Database Mail?

    Las week Rackspace started controlling the number of concurrent SMTP connections and we are now getting the following message when we send as little as 15 messages at a time using Database Mail:
    Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: 4.7.0 smtp13.relay.dfw1a.emailsrvr.com Error: too many connections from IP xxx.xxx.xxx.xxx)
    We are using SQL Server 2005 and Windows 2003 and we have been doing this since 2006 with no problems
    Is there a way to control the number of concurrent SMTP connections used by Database Mail or the Database Mail external executable DatabaseMail90.exe?

    Hi rkohler,
    Usually, we can use the Database Mail Configuration Wizard or the Database Mail stored procedures to determine the server name and port number for the Simple Mail Transfer Protocol (SMTP) server . In the SMTP server points, we can set or increase the number
    of concurrent connections.
    There is similar issue about database email on SQL Server 2005, you can refer to the following post.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6bb7b600-f025-451b-898b-2caa29c10d4d/only-some-email-gets-sent-successfully-from-spsenddbmail-database-mail-on-sql-server-2005
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Error the port of the service registry

    Dear everyone,
    please help me, i got the error message as below:
    Information for this WSDL portType has not been obtained successfully. Some errors have occured.
    (E.g. some of the parent entities might be corrupted or unpublished.)
    Error message:
    WSDLException: faultCode=INVALID_WSDL: java.io.IOException: Connection to localhost:7201 refused
    Actually, my registry is run on port: 7301: http://localhost:7301/registry/uddi/web
    but I don't know why when I log to oracle enterprise manager, registry control and click on find_tmodel, then click to obtain the list of service in this tmodel; i get the error message above.
    Can anyone tell me how can I change the port value?
    Many thanks in advance,
    sophea

    Now it is ok, i can use registry console to change the port.
    registry console -> manage ->registry management - > replace url

  • Java.rmi.ServerException: Missing port information

    when i call the service ,i got the error:
    run-test-client:
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingS
    ender.java:382)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.
    java:234)
    [java] at sys.SetIF_Stub.getdeviceid(SetIF_Stub.java:68)
    [java] at sys.StockPriceFetcher.getdeviceid(Unknown Source)
    [java] at sys.TestPriceFetcher.main(Unknown Source)
    what cause it??
    in my SetImpl.java i use wurfltags.jar
    //SetImpl.java
    package sys;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import net.sourceforge.wurfl.wurflapi.*;
    public class SetImpl implements SetIF {
         private String ret="";
    private ProConf pc;
    private MyObjectsManager mom;
         public SetImpl(){}
    public String getdeviceid(String request)
    String result="";           
    try{              
    mom=new MyObjectsManager();
    mom.wurflWebInit();
    UAManager uam =mom.getUAManagerInstance();
    result=uam.getDeviceIDFromUA("MOT-T720/05.08.41R MIB/2.0 Profile/MIDP-1.0 Configuration/CLDC-1.0");
    System.out.println(result);
    catch(Exception e){}
    return result;     
    and, i generate the wsdl file and deploy it successfully. but in the client
    when i call the service it will be error.
    the client code is:
    /////////StockPriceFetcher.java
    package sys;
    import javax.xml.rpc.*;
    import com.sun.xml.rpc.client.*;
    public final class StockPriceFetcher {
    public static final String getdeviceid(String req,String endpoint) {
    String result="";
    try {
    SetIF_Stub stub =(SetIF_Stub)(new SystemConfiguration_Impl().getSetIFPort());
    stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,endpoint);
    result = stub.getdeviceid(req);
    } catch (Exception ex) {
    ex.printStackTrace();
    return result;
    } // getLonNowItem
    //////////////////////TestPriceTetcher.java
    package sys;
    import java.math.BigDecimal;
    import java.util.*;
    public class TestPriceFetcher {
    public static void main(String[] args) {
    try {
    // String result=StockPriceFetcher.endsetinfo("ball=5&srv=7&pcode=500001","http://192.152.251.224:8080/jaxrpc-sys/jaxrpc");
    String result=StockPriceFetcher.getdeviceid("ball=5&srv=7&pcode=500001","http://192.152.251.224:8080/jaxrpc-sys/jaxrpc");
    System.out.println(result+"bb");
    } catch (Exception ex) {
    ex.printStackTrace();
    when i run the testpricefetcher.java it will raise the above error infomation.
    it spent 2 days for me to find the problem, but i cannot solve it.
    i think it does matter with the wurfl package.because i doesnt use the method of the package in the SetImpl.java it will be ok. How to call the package?please give me a hand.

    can you give me a hand!thank you

  • What are the ports need to open at firewall

    What are the ports need to open at firewall to access Oracle EBS R12 through internet?

    All these following ports need to open at firewall??
    Database Port : 1521
    RPC Port : 1626
    Web SSL Port : 4443
    ONS Local Port : 6100
    ONS Remote Port : 6200
    ONS Request Port : 6500
    Web Listener Port : 8000
    Active Web Port : 8000
    Forms Port : 9000
    Metrics Server Data Port : 9100
    Metrics Server Request Port : 9200
    JTF Fulfillment Server Port : 9300
    MSCA Server Port : 10200-10205
    MCSA Telnet Server Port : 10200,10202,10204
    MSCA Dispatcher Port : 10800
    Java Object Cache Port : 12345
    OC4J JMS Port Range for Oacore : 23000-23004
    OC4J JMS Port Range for Forms : 23500-23504
    OC4J JMS Port Range for Home : 24000-24004
    OC4J JMS Port Range for Oafm : 24500-24504
    OC4J AJP Port Range for Oacore : 21500-21504
    OC4J AJP Port Range for Forms : 22000-22004
    OC4J AJP Port Range for Home : 22500-22504
    OC4J AJP Port Range for Oafm : 25000-25004
    OC4J RMI Port Range for Oacore : 20000-20004
    OC4J RMI Port Range for Forms : 20500-20504
    OC4J RMI Port Range for Home : 21000-21004
    OC4J RMI Port Range for Oafm : 25500-25504
    DB ONS Local Port : 6300
    DB ONS Remote Port : 6400
    Oracle Connection Manager Port : 1521

  • How do I control the TEK TDS3052 by LABVIEW installed in a PC?

    I used the "crossover" cable directly connect the PC and the TEK TDS3052(with a ethernet port).What I have done is that I configured the ethernet parameters( the IP adress, the net mask etc.). And when I apply the "Ping" command in the "run" window of the windows 98, there is a correct return.So the ethernet network is well done.Now I want to use the LABVIEW to control the oscilloscope. But I don't know then.Who can tell me the detail steps which I can take next, thanks a lot.

    Kevin,
    Which version of LabVIEW do you have?
    There are two ways of controlling your oscilloscope from LabVIEW, one is using the VISA functions (instrument i/o palette in LabVIEW)and another one is using an already built instrument driver, which you can download by going to zone.ni.com, and then click on "resource library" at your left... then click in "instrument drivers", and then in "downloads" and then type in the "additional keywords" box type "tds 3052" and click SEEK... you will find a link for your instrument there... you can download that instrument driver and it fully functional with LabVIEW, now... the truth is that I have always used this drivers with a GPIB interface in the computer, in this case is only going to be by TCP/IP... so you can try to adapt the addresses instead of using an instrument type address, use the TCP/IP instrument type address and give it a try to see if it works. The address type for TCP/IP is stated below.
    First you need to have the latest version of NI-VISA installed, 2.5.2, which is shipped with LabVIEW 6i (version 2.5.0 and then download a patch for 2.5.2).
    Our solution for controlling instruments with Ethernet ports is NI-VISA.There are two possible situations:
    1) Instrument supports the VXI-11 protocol.
    The VXI-11 protocol was created to control instruments over Ethernet using the GPIB style. It has nothing to do with VXI, but it was there were it got approved.
    NI-VISA supports VXI-11 instruments, to the point that the only change in the instrument driver written with VISA is the identification string. Instead of using GPIB::1::INSTR, you can use TCPIP::ip address::instrument name::INSTR. (For example, with the Tek TDS 3054, the string would be: TCPIP::130.130.130.1::gpib0,1::INSTR). (Note that 'gpib0,1' has nothing to do GPIB..its just a name given to the instrument..it could have been just 'tds3054' also if the instrument vendor chose to do so).
    2) Instrument DOES NOT support the VXI-11 protocol.
    In this case, you can still use NI-VISA to talk to the instrument using the NI-VISA Ethernet Sockets functions. However, you would have to take care of the specifics of the protocol used for the instrument. The instrument manufacturer should provide you with the details on how to control the instrument (commands, parsing, etc.).
    *** Tek's Scopes ***
    Tek introduced an ethernet interface for some of their scopes. We have a TDS3054 scope from Tek that is VXI-11 compliant. Since the TDS3054 is VXI-11 compliant, we used it at NIWeek to show how you could control it using the same code written for the instrument with the GPIB interface, by just changing the identification string.
    NI-VISA 2.5.2
    NI-VISA 2.5.0 introduced the support for instruments with Ethernet ports. Notice that LabVIEW 6i ships with the older 2.5.0 version. The patch to upgrade it to 2.5.2 is called NiViEnet.dll and is located in the ftp site at:
    ftp://ftp.natinst.com/support/visa/drivers/win32/2.5/patch/
    So you can try this Kevin and see if it works for you, contact us back (www.ni.com/ask) if you need further assistance.
    Good luck!...
    Nestor Sanchez
    Applications Engineer
    National Instruments
    Nestor
    National Instruments

  • How can i control the motor movement of stepper motor using a NI PXI 7330

    Good day to all,
    i'm a newbie in programming in motion control of NI. I just want to ask if how can i control the clockwise and counter-clockwise rotation of a stepper motor using NI PXI 7330 module. all i can do is the counter-clockwise rotation using the example vi (Simple one-axis move.vi) found in the examples of LabView 2009.
    Thanks

    what type of limit switch sensor are you using and how did you wire itß What are your MAX settings regarding the limit switches?
    Good day SIr Jochen,
    I am using two reed switch for the reverse and forward limit. I wired the signal wire of the reed switch to the limit ports(forward and reverse Limit) and its ground to the digital ground of the UMI-7764.
    the attachment below is the my max configuration about limit switches
    Attachments:
    max configuration.JPG ‏155 KB

Maybe you are looking for