I finally figured out how to incorporate the SwiftSocket CocoaPod with my application. I only need a TCP Client, and If I use the Example code I can read data from my TCP Server just fine. However, the example code opens a new connection every time I request data. I need to leave the connection open and read code multiple times later. Every time I call sendRequest() I get a connection closed error message. This seems to be happening because I exit the class containing Socket calls (e.g. "Example Code"). When I go to the TCP Client to send() or read(), fd is clear (0). I am not exactly sure what fd does, but it seems to indicate a connection has been established.
How can I get around this without doing a new connection every time?
I finally figured out how to incorporate the SwiftSocket CocoaPod with my application. I only need a TCP Client, and If I use the Example code I can read data from my TCP Server just fine. However, the example code opens a new connection every time I request data. I need to leave the connection open and read code multiple times later. Every time I call sendRequest() I get a connection closed error message. This seems to be happening because I exit the class containing Socket calls (e.g. "Example Code"). When I go to the TCP Client to send() or read(), fd is clear (0). I am not exactly sure what fd does, but it seems to indicate a connection has been established.
How can I get around this without doing a new connection every time?