diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-02-23 21:47:18 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-23 22:52:16 +0000 |
commit | c42f973180d2e2dd959cfd416bbd5a71aa60cffa (patch) | |
tree | 1cf3cde6f4a53538cb5b4faae44a1cf5cdf6d03d | |
parent | 19089aca83ce00a05dee60b2f40bad87c398fe39 (diff) | |
download | poky-c42f973180d2e2dd959cfd416bbd5a71aa60cffa.tar.gz |
bitbake: Add client socket info for BitBakeServerConnection
In server/client split model, the client will bind to a specific address
and port. We need to pass the values to BitBakeServerConnection().
(Bitbake rev: c8e19c5c389efc06696084c6f9439ba75472c5b7)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uievent.py | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index c53cee488a..eff80098a2 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
@@ -247,9 +247,9 @@ class BitbakeServerInfo(): | |||
247 | self.port = port | 247 | self.port = port |
248 | 248 | ||
249 | class BitBakeServerConnection(): | 249 | class BitBakeServerConnection(): |
250 | def __init__(self, serverinfo): | 250 | def __init__(self, serverinfo, clientinfo=("localhost", 0)): |
251 | self.connection = _create_server(serverinfo.host, serverinfo.port) | 251 | self.connection = _create_server(serverinfo.host, serverinfo.port) |
252 | self.events = uievent.BBUIEventQueue(self.connection) | 252 | self.events = uievent.BBUIEventQueue(self.connection, clientinfo) |
253 | for event in bb.event.ui_queue: | 253 | for event in bb.event.ui_queue: |
254 | self.events.queue_event(event) | 254 | self.events.queue_event(event) |
255 | 255 | ||
diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py index 0e738174e7..28817a22f7 100644 --- a/bitbake/lib/bb/ui/uievent.py +++ b/bitbake/lib/bb/ui/uievent.py | |||
@@ -28,13 +28,14 @@ import socket, threading, pickle | |||
28 | from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler | 28 | from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler |
29 | 29 | ||
30 | class BBUIEventQueue: | 30 | class BBUIEventQueue: |
31 | def __init__(self, BBServer): | 31 | def __init__(self, BBServer, clientinfo=("localhost, 0")): |
32 | 32 | ||
33 | self.eventQueue = [] | 33 | self.eventQueue = [] |
34 | self.eventQueueLock = threading.Lock() | 34 | self.eventQueueLock = threading.Lock() |
35 | self.eventQueueNotify = threading.Event() | 35 | self.eventQueueNotify = threading.Event() |
36 | 36 | ||
37 | self.BBServer = BBServer | 37 | self.BBServer = BBServer |
38 | self.clientinfo = clientinfo | ||
38 | 39 | ||
39 | self.t = threading.Thread() | 40 | self.t = threading.Thread() |
40 | self.t.setDaemon(True) | 41 | self.t.setDaemon(True) |
@@ -72,7 +73,7 @@ class BBUIEventQueue: | |||
72 | 73 | ||
73 | def startCallbackHandler(self): | 74 | def startCallbackHandler(self): |
74 | 75 | ||
75 | server = UIXMLRPCServer() | 76 | server = UIXMLRPCServer(self.clientinfo) |
76 | self.host, self.port = server.socket.getsockname() | 77 | self.host, self.port = server.socket.getsockname() |
77 | 78 | ||
78 | server.register_function( self.system_quit, "event.quit" ) | 79 | server.register_function( self.system_quit, "event.quit" ) |
@@ -98,7 +99,7 @@ class BBUIEventQueue: | |||
98 | 99 | ||
99 | class UIXMLRPCServer (SimpleXMLRPCServer): | 100 | class UIXMLRPCServer (SimpleXMLRPCServer): |
100 | 101 | ||
101 | def __init__( self, interface = ("localhost", 0) ): | 102 | def __init__( self, interface ): |
102 | self.quit = False | 103 | self.quit = False |
103 | SimpleXMLRPCServer.__init__( self, | 104 | SimpleXMLRPCServer.__init__( self, |
104 | interface, | 105 | interface, |