Index: src/rsrv/caservertask.c =================================================================== RCS file: /cvs/G/EPICS/base-3.14.12/src/rsrv/caservertask.c,v retrieving revision 1.1 retrieving revision 1.4 diff -u -r1.1 -r1.4 --- src/rsrv/caservertask.c 29 Nov 2010 10:38:07 -0000 1.1 +++ src/rsrv/caservertask.c 23 May 2013 09:16:42 -0000 1.4 @@ -37,6 +37,8 @@ #include "dbEvent.h" #include "dbCommon.h" #include "epicsStdioRedirect.h" +#include "epicsExit.h" +#include "epicsString.h" #define epicsExportSharedSymbols #include "rsrv.h" @@ -110,6 +112,15 @@ status = bind ( IOC_sock, (struct sockaddr *) &serverAddr, sizeof ( serverAddr ) ); if ( status < 0 ) { if ( SOCKERRNO == SOCK_EADDRINUSE ) { +#ifndef vxWorks + const char* multiple_iocs = getenv("EPICS_ALLOW_MULTIPLE_IOCS"); + if (multiple_iocs && epicsStrCaseCmp(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); + } +#endif /* * enable assignment of a default port * (so the getsockname() call below will