I wanted to write a socket program in C, where I always want my socket connected to the server. i.e i shouldn't get disconnected once i get the response back from the server. I want to work in the connected mode, instead of disconnect and connect.
Can somebody please kindly provide me a sample code how i will always be in connected mode to the server. ( Unix enviornment)
Program your client so that it doesn't disconnect itself, and tell the server not to disconnect your client when it's done. If that's possible depends on the protocol (of which you haven't told us anything), but HTTP and SMTP, for example, can work like this (although it's not exactly nice to hog up free sockets).
HTTP doesn't keep connection all the time. Isn't it?
@Topic
You can implement a socket program the way you like. Why should anyone want to have connection all the time, even when client and server have no communication going on?