That error is most likely why things are not working correctly. That error generally means you are attempting to do something odd with the data you are sending and receiving.
– Are you only sending and receiving string objects at this point?
– Does your client or server write anything out to disk?
To find out more enable logging on both client and server see this article, https://networkcomms.net/enable-logging/. If you post the log files somewhere that I can access them the problem is generally apparent.
N.B Thanks for the beer.