Netwolf Posted May 16, 2014 Share Posted May 16, 2014 hi guys. im working on a program that can communicate over a tcp connection. for now only client is supposed to listen the other will send data. according to that data the first client will then react. there will only be one type of data: different string values. my question is whether i need to close the socket after receiving data in order to send new data. or if i can just keep the socket open and basically loop tcpsend() once the tcpconnect() is established since its the same connection. so basic structure : tcpstartup() tcplisten() tcpaccept() ____________________tcpconnect() loop tcprecv()_____________________tcpsend() until "whatever " or tcpaccept = -1 tcpclosesocket(tcpaccept()) tcpclosesocket(tcplisten()) tcpshutdown() Link to comment Share on other sites More sharing options...
Celtic88 Posted May 16, 2014 Share Posted May 16, 2014 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now