Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyxtcp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyxtcp

Tcp-based communication protocol, RPC protocol

  • 1.1.9
  • PyPI
  • Socket score

Maintainers
1

Pyxtcp

HTTP-based communication protocol, RPC protocol

You can install pyxtcp from PyPI with

.. sourcecode:: bash

$ pip install pyxtcp

Protocol

  • format:

    .. sourcecode:: text

      /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

    .. sourcecode:: python

      #!/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

    .. sourcecode:: python

          #!/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_.

.. _github issue: https://github.com/nashuiliang/xtcp/issues

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc