def start_server(): logger = logging.getLogger(__name__) logger.info("Starting sequencer server on port {0}:{1}".format( global_config.SEQUENCER_HOST, global_config.SEQUENCER_PORT)) server = protobuf.socketrpc.server.SocketRpcServer( global_config.SEQUENCER_PORT, "0.0.0.0") server.registerService(SequencerServiceImpl(logger)) try: server.run() except KeyboardInterrupt: sys.exit(0)
def main(server_index): logger = logging.getLogger(__name__) host, port = global_config.SERVER_ADDR_LIST[server_index] # Start the server. logger.info("Starting flash server {0} on {1}:{2}".format(server_index, host, port)) server = protobuf.socketrpc.server.SocketRpcServer(port, "0.0.0.0") try: with FlashUnit(server_index, global_config) as flash_unit: server.registerService(FlashServiceImpl(flash_unit)) server.run() except KeyboardInterrupt: sys.exit(0)
def run(): # Import required RPC modules import protobuf.socketrpc.server as server from controller import protobufServerImpl as impl # Create and register the service # Note that this is an instantiation of the implementation class, # *not* the class defined in the proto file. server_service = impl.ProtobufServerImpl() server = server.SocketRpcServer(8090) server.registerService(server_service) # Start the server print 'Serving on port 8090' server.run()
def main(server_index): logger = logging.getLogger(__name__) host, port = global_config.SERVER_ADDR_LIST[server_index] # Start the server. logger.info("Starting flash server {0} on {1}:{2}".format( server_index, host, port)) server = protobuf.socketrpc.server.SocketRpcServer(port, "0.0.0.0") try: with FlashUnit(server_index, global_config) as flash_unit: server.registerService(FlashServiceImpl(flash_unit)) server.run() except KeyboardInterrupt: sys.exit(0)
#!/usr/bin/python2 # Import required RPC modules import protobuf.socketrpc.server import jdwp import jdwp_pb2 import jdwp_impl # Create and register the service # Note that this is an instantiation of the implementation class, # *not* the class defined in the proto file. jdwp = jdwp.Jdwp() server = protobuf.socketrpc.server.SocketRpcServer(10001) server.registerService(jdwp_impl.VirtualMachineImpl(jdwp)) server.registerService(jdwp_impl.EventRequestImpl(jdwp)) server.registerService(jdwp_impl.EventImpl(jdwp)) # Start the server print('Serving on port 10001') server.run()