mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
19089aca83
commit
c42f973180
@@ -247,9 +247,9 @@ class BitbakeServerInfo():
|
|||||||
self.port = port
|
self.port = port
|
||||||
|
|
||||||
class BitBakeServerConnection():
|
class BitBakeServerConnection():
|
||||||
def __init__(self, serverinfo):
|
def __init__(self, serverinfo, clientinfo=("localhost", 0)):
|
||||||
self.connection = _create_server(serverinfo.host, serverinfo.port)
|
self.connection = _create_server(serverinfo.host, serverinfo.port)
|
||||||
self.events = uievent.BBUIEventQueue(self.connection)
|
self.events = uievent.BBUIEventQueue(self.connection, clientinfo)
|
||||||
for event in bb.event.ui_queue:
|
for event in bb.event.ui_queue:
|
||||||
self.events.queue_event(event)
|
self.events.queue_event(event)
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ import socket, threading, pickle
|
|||||||
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
|
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
|
||||||
|
|
||||||
class BBUIEventQueue:
|
class BBUIEventQueue:
|
||||||
def __init__(self, BBServer):
|
def __init__(self, BBServer, clientinfo=("localhost, 0")):
|
||||||
|
|
||||||
self.eventQueue = []
|
self.eventQueue = []
|
||||||
self.eventQueueLock = threading.Lock()
|
self.eventQueueLock = threading.Lock()
|
||||||
self.eventQueueNotify = threading.Event()
|
self.eventQueueNotify = threading.Event()
|
||||||
|
|
||||||
self.BBServer = BBServer
|
self.BBServer = BBServer
|
||||||
|
self.clientinfo = clientinfo
|
||||||
|
|
||||||
self.t = threading.Thread()
|
self.t = threading.Thread()
|
||||||
self.t.setDaemon(True)
|
self.t.setDaemon(True)
|
||||||
@@ -72,7 +73,7 @@ class BBUIEventQueue:
|
|||||||
|
|
||||||
def startCallbackHandler(self):
|
def startCallbackHandler(self):
|
||||||
|
|
||||||
server = UIXMLRPCServer()
|
server = UIXMLRPCServer(self.clientinfo)
|
||||||
self.host, self.port = server.socket.getsockname()
|
self.host, self.port = server.socket.getsockname()
|
||||||
|
|
||||||
server.register_function( self.system_quit, "event.quit" )
|
server.register_function( self.system_quit, "event.quit" )
|
||||||
@@ -98,7 +99,7 @@ class BBUIEventQueue:
|
|||||||
|
|
||||||
class UIXMLRPCServer (SimpleXMLRPCServer):
|
class UIXMLRPCServer (SimpleXMLRPCServer):
|
||||||
|
|
||||||
def __init__( self, interface = ("localhost", 0) ):
|
def __init__( self, interface ):
|
||||||
self.quit = False
|
self.quit = False
|
||||||
SimpleXMLRPCServer.__init__( self,
|
SimpleXMLRPCServer.__init__( self,
|
||||||
interface,
|
interface,
|
||||||
|
|||||||
Reference in New Issue
Block a user