Yes, it's the code you pasted above. If the connection disconnected in the same way as in rar then it's not WF10 or your resource adapter problem.
I am in process of doing a simple test class -
TestSockConnector.java
. it can be found here https://drive.google.com/open?id=0Bx_7eiy_kFj7U2piZWk3ZHdkd0U
I am stuck at the point of what do I use for
TCPConnectionFactory factory;
ManagedTCPConnectionFactory managedTCPConnectionFactory
See lines 69-73
These needs implementation that are Java EE
I took a look at the code and what you need is to try in separate project is TCPManager class. Modify its constructors so no "resource adapter" classes are needed and instantiate new connection using connect(...) method.