New environment to disallow 2 iocs on the same computer
This commit is contained in:
@@ -110,6 +110,13 @@ static void req_server (void *pParm)
|
||||
status = bind ( IOC_sock, (struct sockaddr *) &serverAddr, sizeof ( serverAddr ) );
|
||||
if ( status < 0 ) {
|
||||
if ( SOCKERRNO == SOCK_EADDRINUSE ) {
|
||||
const char* multiple_iocs = getenv("EPICS_ALLOW_MULTIPLE_IOCS");
|
||||
if (multiple_iocs && strcasecmp(multiple_iocs, "NO") == 0)
|
||||
{
|
||||
errlogPrintf ( "CAS: Default server port %d unavailable.\n" ,ca_server_port);
|
||||
errlogPrintf ( "CAS: Probably already running an IOC on this computer.\n");
|
||||
epicsExit(1);
|
||||
}
|
||||
/*
|
||||
* enable assignment of a default port
|
||||
* (so the getsockname() call below will
|
||||
|
||||
Reference in New Issue
Block a user