I want a simple client server communication which I can use an underlying framework and never have to look at again. I want to concentrate on my application and have a simple functional API along the lines of:
SendStringFromClentToServer() : String; // Returns the server result string
// or "" on etror (or throws exception)
ProcessReceivedStringAtServer(); // And send result string
- I do need to know if the server replied or not; and, if so, what the result string was
- It would be nice if the serer used Indy Command Handler, but not vital as I can parse the received string myself
- also "nice to have" and where the INDY demos don't seem to cover it (except, reportedly, the SMTP demo, which I can't seem to find) would be for the server to initiate communication to the client. IF not, I can have the client poll, or have the server send its communication as a reply to the client heartbeat which I need to add.
Thanks a 1,000,000 in advance. A URL or name of an Indy 10 demo will suffice
Update: I really don't want my app to have to know anything about sockets (other than inditing an IP address and port number).
I don't want to know that there is a connection, let alone whether it is is always open or connected with each transmission request (and, if always open, I want it to auto-reopen if it closes). At most, a boolean for those who care to indicate "keep connection open".
Update to the update: Should I close this question and post another, rephrasing it better? Surely I'm not the only one who "just wants to send some data to another PC" and doesn't really care how it is done? Isn't there an existing framework? How do you guys start each new project? Do you have a simple dummy project which handles the "plumbing" to which you add your new application? Do you know of such a thing?
来源:https://stackoverflow.com/questions/8904896/seeking-simple-indy-demo