Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Tcp-based communication protocol, RPC protocol

Project description

HTTP-based communication protocol, RPC protocol

You can install pyxtcp from PyPI with

$ pip install pyxtcp

Protocol

  • format:

    /topic/method?v={params}
    

Version update

  • 1.1.3 添加 HTTP POST 转发为 GET 请求
  • 1.1.2 稳定,测试
  • 1.1.1 统一 HTTP-based RPC 返回信息
  • 1.1.0 添加 HTTP-based RPC
  • 1.0.2 添加client_handler, Service, server_callback_by_json
  • 1.0.1 initialize project

Getting Started

  • server

    #!/usr/bin/env python
    # coding=utf-8
    
    import logging
    logging.basicConfig(level=logging.DEBUG)
    
    from pyxtcp.http import RPCServer, Service
    service = Service()
    
    
    class CompanyService(object):
    
        @staticmethod
        @service.with_f_rpc
        def get_company_by_company_id(company_id):
            logging.warn(("HiHi", company_id))
            return "wwwwwwwwwwwwwwwww{}".format(company_id)
    
    if __name__ == "__main__":
        port = 8001
        app = RPCServer(8001, "0.0.0.0")
        app.add_service(service)
        app.run()
    
  • client

    #!/usr/bin/env python
    # coding=utf-8
    
    import logging
    logging.basicConfig(level=logging.INFO)
    from pyxtcp.http import RPCClient
    
    company = RPCClient("localhost:8001").service_name("CompanyService")
    
    logging.info(company.get_company_by_company_id(company_id=7))
    

Support

If you need help using pyxtcp or have found a bug, please open a github issue.

Project details


Release history Release notifications

This version
History Node

1.1.9

History Node

1.1.8

History Node

1.1.7

History Node

1.1.6

History Node

1.1.5

History Node

1.1.4

History Node

1.1.3

History Node

1.1.1

History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyxtcp-1.1.9-py2.7.egg (65.4 kB) Copy SHA256 hash SHA256 Egg 2.7 Nov 3, 2015
pyxtcp-1.1.9.tar.gz (10.0 kB) Copy SHA256 hash SHA256 Source None Nov 3, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page