I am developing a mobile application that transmit date using TCP protocol ( sockets ). What is the perfect solution ? is to open socket and send message, and if I wan to send another message I need to repeat the same sequence, open>send>close ? OR, open>send>..keep the socket open..>send again>..>close ??
If I want to implements chat service such as instant messages , is it good to close the socket after each message , as the traffic is a big consideration ?
I hope the question is clear