David Brodrick - 2015-01-30

Hi Dieter,
We had problems with jamod not properly reporting a broken socket vs a timeout to an unresponsive slave. From the forum it looks like others have also ran into this. I attach a fix (and fix an unrelated null pointer exception), if you'd consider merging them?
Cheers,
Dave

jamod-1.2rc1-src/src/net/wimpi/modbus/io/ModbusTCPTransaction.java
176a177
> 
195,199c196,197
<         if (ex.isEOF()) {
<           throw ex;
<         } else if (retryCounter == m_Retries) {
<           //Pre
<           throw new ModbusIOException("Executing transaction failed (retried " + m_Retries + " times)");
---
>         if (retryCounter == m_Retries) {
>           throw new ModbusIOException("Executing transaction failed (tried " + m_Retries + " times)");

jamod-1.2rc1-src/src/net/wimpi/modbus/io/ModbusTCPTransport.java
109c109
<       throw new ModbusIOException("I/O exception - failed to write", true);
---
>       throw new ModbusIOException("I/O exception - failed to write.");

jamod-1.2rc1-src/src/net/wimpi/modbus/net/TCPMasterConnection.java
143,148c143,146
<     if (m_Socket!=null) {
<       try {
<         m_Socket.setSoTimeout(m_Timeout);
<       } catch (IOException ex) {
<         //handle?
<       }
---
>     try {
>       m_Socket.setSoTimeout(m_Timeout);
>     } catch (IOException ex) {
>       //handle?