23 class CMSRPServerSubSession; |
23 class CMSRPServerSubSession; |
24 class CMSRPMessageHandler; |
24 class CMSRPMessageHandler; |
25 |
25 |
26 enum TStates |
26 enum TStates |
27 { |
27 { |
28 EIdle = 0, |
28 EIdle, |
29 EConnecting, |
29 EConnecting, |
30 EWaitForClient, |
30 EWaitForClient, |
31 EActive, |
31 EActive, |
32 EActiveSend, |
32 EError |
33 EFileShare, |
|
34 EError, |
|
35 EEndLine |
|
36 }; |
33 }; |
37 |
34 |
38 |
35 |
39 class TStateBase |
36 class TStateBase |
40 { |
37 { |
41 public: |
38 public: |
42 virtual TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext)=0; |
39 virtual TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext)=0; |
43 virtual TStateBase* HandleStateErrorL(CMSRPServerSubSession *aContext); |
40 virtual TStateBase* HandleStateErrorL(CMSRPServerSubSession *aContext); |
44 virtual TStateBase * processIncommingMessageL(CMSRPServerSubSession *aContext, CMSRPMessageHandler* incommingMsg = NULL); |
41 virtual TStateBase * processIncommingMessageL(CMSRPServerSubSession *aContext, CMSRPMessageHandler* incommingMsg = NULL); |
45 TStateBase * processPendingMessageQL( CMSRPServerSubSession *aContext ); |
42 TStateBase * processPendingMessageQL( CMSRPServerSubSession *aContext ); |
|
43 TStateBase * processCompletedMessageL( CMSRPServerSubSession *aContext ); |
|
44 TStateBase * processCompletedIncomingMessageL( CMSRPServerSubSession *aContext ); |
|
45 TStateBase * processReceiveReportL( CMSRPServerSubSession *aContext ); |
|
46 TStateBase * processSendReportL( CMSRPServerSubSession *aContext ); |
46 virtual TStateBase * handlesResponseL(CMSRPServerSubSession *aContext, |
47 virtual TStateBase * handlesResponseL(CMSRPServerSubSession *aContext, |
47 CMSRPMessageHandler *incommingMsgHandler); |
48 CMSRPMessageHandler *incommingMsgHandler); |
48 |
49 |
49 virtual TStateBase* handleRequestsL(CMSRPServerSubSession *aContext, |
50 virtual TStateBase* handleRequestsL(CMSRPServerSubSession *aContext, |
50 CMSRPMessageHandler *incommingMsgHandler); |
51 CMSRPMessageHandler *incommingMsgHandler); |
51 |
52 |
52 TStateBase* handleClientListnerCancelL(CMSRPServerSubSession * aContext, |
53 TStateBase* handleClientListnerCancelL(CMSRPServerSubSession * aContext, |
53 TMSRPFSMEvent aEvent); |
54 TMSRPFSMEvent aEvent); |
|
55 TStateBase* HandleClientCancelSendingL(CMSRPServerSubSession * aContext ); |
54 TStateBase* handleConnectionStateChangedL(CMSRPServerSubSession *aContext); |
56 TStateBase* handleConnectionStateChangedL(CMSRPServerSubSession *aContext); |
55 TStateBase* handleQueuesL(CMSRPServerSubSession *aContext); |
57 TStateBase* handleQueuesL(CMSRPServerSubSession *aContext); |
56 TStateBase* handleConnectionErrorsL(CMSRPServerSubSession *aContext); |
58 TStateBase* handleConnectionErrorsL(CMSRPServerSubSession *aContext); |
57 virtual TStates identity()=0; |
59 virtual TStates identity()=0; |
58 TStateBase* handleInCommingMessagesL(CMSRPServerSubSession *aContext); |
60 TStateBase* handleInCommingMessagesL(CMSRPServerSubSession *aContext); |
59 TStateBase* handleSendFileL(CMSRPServerSubSession *aContext); |
61 TStateBase* handleCancelFileSendingL(CMSRPServerSubSession *aContext); |
60 TStateBase* handleReceiveFileL(CMSRPServerSubSession *aContext); |
62 TStateBase* MessageSendCompleteL(CMSRPServerSubSession *aContext); |
61 }; |
63 }; |
62 |
64 |
63 |
65 |
64 class TStateIdle : public TStateBase |
66 class TStateIdle : public TStateBase |
65 { |
67 { |
89 class TStateWaitForClient : public TStateBase |
91 class TStateWaitForClient : public TStateBase |
90 { |
92 { |
91 public: |
93 public: |
92 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
94 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
93 TStates identity(); |
95 TStates identity(); |
94 |
|
95 private: |
|
96 TStateBase* fileSendCompleteL(CMSRPServerSubSession *aContext); |
|
97 TStateBase * handleResponseSentL( CMSRPServerSubSession *aContext); |
|
98 |
|
99 }; |
96 }; |
100 |
97 |
101 |
98 |
102 class TStateActive : public TStateBase |
99 class TStateActive : public TStateBase |
103 { |
100 { |
104 public: |
101 public: |
105 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
102 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
106 TStates identity(); |
103 TStates identity(); |
107 |
104 |
108 private: |
105 private: |
109 TStateBase* handleSendDataL(CMSRPServerSubSession *aContext); |
106 TStateBase* handleSendDataL( CMSRPServerSubSession* aContext ); |
110 |
107 TStateBase* handleResponseSentL( CMSRPServerSubSession* aContext); |
|
108 TStateBase* handleReportSentL( CMSRPServerSubSession* aContext); |
111 }; |
109 }; |
112 |
|
113 |
|
114 class TStateFileShare : public TStateBase |
|
115 { |
|
116 public: |
|
117 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
|
118 TStates identity(); |
|
119 |
|
120 private: |
|
121 TStateBase * processIncommingMessageL(CMSRPServerSubSession *aContext, CMSRPMessageHandler* incommingMsg = NULL); |
|
122 |
|
123 TStateBase* fileSendCompleteL(CMSRPServerSubSession *aContext); |
|
124 TStateBase * handlesResponseL(CMSRPServerSubSession *aContext, |
|
125 CMSRPMessageHandler *incommingMsgHandler); |
|
126 |
|
127 TStateBase* handleRequestsL(CMSRPServerSubSession *aContext, |
|
128 CMSRPMessageHandler *incommingMsgHandler); |
|
129 TStateBase * handleResponseSentL( CMSRPServerSubSession *aContext); |
|
130 |
|
131 TStateBase * handleSendProgressL( CMSRPServerSubSession *aContext); |
|
132 |
|
133 TStateBase * handleReceiveProgressL( CMSRPServerSubSession *aContext); |
|
134 |
|
135 }; |
|
136 |
|
137 |
|
138 class TStateActiveSend : public TStateBase |
|
139 { |
|
140 public: |
|
141 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
|
142 TStates identity(); |
|
143 |
|
144 private: |
|
145 TStateBase * MessageSendCompleteL(CMSRPServerSubSession *aContext); |
|
146 |
|
147 }; |
|
148 |
|
149 |
110 |
150 class TStateError : public TStateBase |
111 class TStateError : public TStateBase |
151 { |
112 { |
152 public: |
113 public: |
153 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |
114 TStateBase* EventL(TMSRPFSMEvent aEvent, CMSRPServerSubSession *aContext); |