Changeset 2392 for trunk/rms

Show
Ignore:
Timestamp:
12/14/00 05:44:06 (8 years ago)
Author:
graham
Message:

Read the port from the config file.

Location:
trunk/rms
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rms/src/rms.cpp

    r2348 r2392  
    141141int CLicqRMS::Run(CICQDaemon *_licqDaemon) 
    142142{ 
     143  unsigned short nPort; 
     144 
    143145  // Register with the daemon, we only want the update user signal 
    144146  m_nPipe = _licqDaemon->RegisterPlugin(SIGNAL_UPDATExUSER); 
     
    151153  { 
    152154    conf.SetSection("RMS"); 
    153     //conf.ReadNum("Type", m_nForwardType, FORWARD_EMAIL); 
     155    conf.ReadNum("Port", nPort, 0); 
    154156    conf.CloseFile(); 
    155157  } 
     
    157159  server = new TCPSocket(0); 
    158160 
    159   if (!licqDaemon->StartTCPServer(server)) return 1; 
     161  if (licqDaemon->TCPPortsLow() != 0 && nPort == 0) 
     162  { 
     163    if (!licqDaemon->StartTCPServer(server)) return 1; 
     164  } 
     165  else 
     166  { 
     167    server->StartServer(nPort); 
     168  } 
     169 
    160170  gLog.Info("%sRMS server started on port %d.\n", L_RMSxSTR, server->LocalPort()); 
    161171  CRMSClient::sockman.AddSocket(server);