src/eric7/RemoteServer/EricServerDebuggerRequestHandler.py

branch
server
changeset 10597
fbe93720ee9f
parent 10574
622e59b51640
child 10610
bb0149571d94
equal deleted inserted replaced
10596:ea35c92a3c7c 10597:fbe93720ee9f
29 29
30 @param server reference to the eric-ide server object 30 @param server reference to the eric-ide server object
31 @type EricServer 31 @type EricServer
32 """ 32 """
33 self.__server = server 33 self.__server = server
34 34
35 self.__requestMethodMapping = { 35 self.__requestMethodMapping = {
36 "StartClient": self.__startClient, 36 "StartClient": self.__startClient,
37 "StopClient": self.__stopClient, 37 "StopClient": self.__stopClient,
38 "DebugClientCommand": self.__relayDebugClientCommand 38 "DebugClientCommand": self.__relayDebugClientCommand,
39 } 39 }
40 40
41 self.__mainClientId = None 41 self.__mainClientId = None
42 self.__client = None 42 self.__client = None
43 self.__inStartClient = False 43 self.__inStartClient = False
120 ) 120 )
121 121
122 def __serviceDbgClientConnection(self, key): 122 def __serviceDbgClientConnection(self, key):
123 """ 123 """
124 Private method to service the debug client connection. 124 Private method to service the debug client connection.
125 125
126 @param key reference to the SelectorKey object associated with the connection 126 @param key reference to the SelectorKey object associated with the connection
127 to be serviced 127 to be serviced
128 @type selectors.SelectorKey 128 @type selectors.SelectorKey
129 """ 129 """
130 sock = key.fileobj 130 sock = key.fileobj
136 elif data: 136 elif data:
137 method = data["method"] 137 method = data["method"]
138 138
139 # 1. process debug client messages before relaying 139 # 1. process debug client messages before relaying
140 if method == "DebuggerId" and sock in self.__pendingConnections: 140 if method == "DebuggerId" and sock in self.__pendingConnections:
141 debuggerId = data['params']['debuggerId'] 141 debuggerId = data["params"]["debuggerId"]
142 self.__connections[debuggerId] = sock 142 self.__connections[debuggerId] = sock
143 self.__pendingConnections.remove(sock) 143 self.__pendingConnections.remove(sock)
144 if self.__mainClientId is None: 144 if self.__mainClientId is None:
145 self.__mainClientId = debuggerId 145 self.__mainClientId = debuggerId
146 146
154 self.__server.sendJson( 154 self.__server.sendJson(
155 category=EricRequestCategory.Debugger, 155 category=EricRequestCategory.Debugger,
156 reply="DebugClientResponse", 156 reply="DebugClientResponse",
157 params={"response": jsonStr}, 157 params={"response": jsonStr},
158 ) 158 )
159 159
160 # 3. process debug client messages after relaying 160 # 3. process debug client messages after relaying
161 if method == "ResponseExit": 161 if method == "ResponseExit":
162 for sock in list(self.__connections.values()): 162 for sock in list(self.__connections.values()):
163 if not self.__server.isSocketClosed(sock): 163 if not self.__server.isSocketClosed(sock):
164 self.__clientSocketDisconnected(sock) 164 self.__clientSocketDisconnected(sock)

eric ide

mercurial