I am writing a client/server application that will publish and subscribe to topics. I have few questions about the architecture and the implementation for this project.
First to setup the basis i will use c# ( .NET 3.5 ) and i want to explicitly use raw Sockets/AIO/Threads(No WCF at first as i do want to fine tune the server and clients to my needs ). Clients mostly subscribe to topics but may occasionally send command to the server and even publish data . Some clients may be publishers only as well.
What do you think should be the basic building blocks of my server ( threads per client , iocp, .... ).
Should client use the same NetworkStream to listen subscribed topics and send command/publish to the server? How to wait for data and at the same time write data to the stream , should this be done in the same thread ?
(sample code will be appreciated :) )