> I need to write a TService application that will > receive (potentially) multiple client TCP connections > concurrently, and perform some simple stateful > transactions with them. For example: > > 1. Client-A connects to the server > 2. Server responds with banner > 3. Client-A sends data > 4. Client-A sends end-of-data marker > 5. Server responds with ERR or OK code > 6. Server responds with receipt ID > 7. Client-A closes connection > > As you can see, its sort of like an SMPT server, > but much, much simpler. Does TWSocket support > multiple concurrent connections?
Yes, TWSocketServer support an unlimited concurrent connections (well they are limited by hardware and OS resources). > If not, do I need > to implement this by spawning a new thread for each > client, or is there a more efficient way? You don't need multithreading, but you can use it if processing require lengthy operation, or if you want to take advantage of multi-core CPU. I suggest you clearly separate communication (TWSocketServer) and processing, and use a single thread for communication and one thread per client for processing. There is also a multithreaded TWSocketServer available. It was designed by Arno. > Is there an example of such application? Yes, there are several multiclient and multithread samples. The more recent, the best they are. Look at both V5 and V6 since all V5 sample have not yet been converted to V6). Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be