public static synchronized ModbusSlave createUDPSlave ( InetAddress address , int port ) throws ModbusException { String key = ModbusSlaveType . UDP . getKey ( port ) ; if ( slaves . containsKey ( key ) ) { return slaves . get ( key ) ; } else { ModbusSlave slave = new ModbusSlave ( address , port , false ) ; slaves . put ( key , slave ) ; return slave ; } }
Creates a UDP modbus slave or returns the one already allocated to this port