Client-server QT Tool for Managing PPC (PowerPC)

来源:互联网 发布:php和c语言哪个难 编辑:程序博客网 时间:2024/06/06 08:46

         The first English article I am trying to write.

1、  The characteristic of PPC

        1) User does not need to log in. So long as the PPC is idle, user can connect it using socket.

        2) One PPC can only be connected to one user. When it is connected by someone, the others won’t connect this PPC anymore.

        So the question is how can I connect all the PPCs that is idle, to let others must use the client to apply PPC?

        Originally, I thought that I need mutiple thread to connect so many PPCs, but it turned out to be a wrong method. Because one QTcpSocker object can only be used to connect one PPC.

        Every PPC must be connected by corresponding QTcpSocket object. Sowe need more than one QTcpSocket object. So the way to achieve it is define a List that contain QTcpSocket * data.

 

2、  Which kind of client- server model I should choose?

        QT assistant and C++ GUI programming introduce two kinds model for each. The client can be blocking and non-blocking. The server can be single-thread and multiple-threads.

        Because the number of user is little, so the client has no need to beblocking. And the server will bemultiple threads.

3、Defining data needed to be transported between clients and server

        1)      Occupancy of PPC

        2)    User of PPC

        3)      Request for getting and returning PPC


0 0
原创粉丝点击