Seems a little long winded to just initiate, read, and write. I do suppose some of that is parsing the strings and processing of data though. May be able to hard code in some catch algorithms to automatically reply to Ping calls so the connection doesn't have to rely on outside support to maintain the connection.