c# - Writing a topic pub/sub system -


I am writing client / server applications that will publish and subscribe to topics. I have some questions about architecture and the implementation of this project.

To install the base, I will first use C # (.NET 3.5) and I want to explicitly use raw socket / AIO / threads (not the first WCF, because I have a server And my customers want to tune up properly. Customers subscribe to most topics but can sometimes send commands to the server and publish data. Some clients may only be publishers.

  1. Do you think my server should have basic building blocks (per client, thread, iocp, ....)

  2. Does the client use the same network stream to listen to subscribing topics and to publish on command / server? How to wait for data and to write data at the same time, should it be done in a single thread?

(The sample code will be appreciated :))

  • The customer should use two streams - one for the list and the other to make things easier on both the client and the server side, again several threads Use async sockets to avoid managing.

  • Be sure to carefully manage locking with shared resources used by your asynchronous callback. If possible, the shared resources could not be as viable as possible. Managin's access to contemporary things is usually the worst part of any app.


    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    What is expire header and how to achive them in ASP.NET and PHP? -

    sql server - How can I determine which of my SQL 2005 statistics are unused? -