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()
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. ''' run_server.py - A simple front-end to demo the RPC server implementation. Author: Eric Saunders ([email protected]) Jan Dittberner ([email protected]) May 2009, Nov 2010 ''' # Add main protobuf module to classpath import sys sys.path.append('../../../..') # Import required RPC modules import hello_world_pb2 import protobuf.socketrpc.server as server import HelloWorldServiceImpl 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. hello_world_service = impl.HelloWorldImpl() server = server.SocketRpcServer(8090) server.registerService(hello_world_service) # Start the server print 'Serving on port 8090' server.run()
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. ''' run_server.py - A simple front-end to demo the RPC server implementation. Author: Eric Saunders ([email protected]) Jan Dittberner ([email protected]) May 2009, Nov 2010 ''' # Add main protobuf module to classpath import sys sys.path.append('../../main') # Import required RPC modules import protobuf.socketrpc.server as server import HelloWorldServiceImpl 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. hello_world_service = impl.HelloWorldImpl() server = server.SocketRpcServer(8090) server.registerService(hello_world_service) # Start the server print 'Serving on port 8090' server.run()
import sys import ReplicantSrvrImpl as impl import protobuf.socketrpc.server as server import chunks_pb2 if not len(sys.argv) > 1: print 'Parameter missing!' sys.exit() if sys.argv[1] == 'server': replicant_service = impl.ReplicantSrvrImpl() server = server.SocketRpcServer(8090) server.registerService(replicant_service) # Start the server print 'Serving on port 8090' server.run() if sys.argv[1] == 'client': from protobuf.socketrpc import RpcService import logging log = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) # Server details hostname = 'localhost' port = 8090 # Create a request request = chunks_pb2.Chunk() request.id = 'Id del chunk'
#!/usr/bin/env python import t_pb2 import protobuf.socketrpc.server #class t_service_imp(t_pb2.t_service): # a if __name__ == '__main__': server = protobuf.socketrpc.server.SocketRpcServer(10081) server.registerService(t_pb2.t_service()) server.run()
import sys import ReplicantSrvrImpl as impl import protobuf.socketrpc.server as server import chunks_pb2 if not len(sys.argv) > 1: print "Parameter missing!" sys.exit() if sys.argv[1] == "server": replicant_service = impl.ReplicantSrvrImpl() server = server.SocketRpcServer(8090) server.registerService(replicant_service) # Start the server print "Serving on port 8090" server.run() if sys.argv[1] == "client": from protobuf.socketrpc import RpcService import logging log = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) # Server details hostname = "localhost" port = 8090 # Create a request request = chunks_pb2.Chunk() request.id = "Id del chunk"
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ Description : Start the Vision Server Authors: Mathieu Benoit ([email protected]) Date : October 2012 """ # Project path is parent directory import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0, parentdir) # Import required RPC modules import protobuf.socketrpc.server as server from vServer import vServerServiceImpl 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. vserver_service = impl.VServerImpl() server = server.SocketRpcServer(8090) server.registerService(vserver_service) # Start the server print 'Serving on port 8090' server.run()