当前位置: 首页>>代码示例>>Python>>正文


Python ServerProxy.send方法代码示例

本文整理汇总了Python中xmlrpc.client.ServerProxy.send方法的典型用法代码示例。如果您正苦于以下问题:Python ServerProxy.send方法的具体用法?Python ServerProxy.send怎么用?Python ServerProxy.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xmlrpc.client.ServerProxy的用法示例。


在下文中一共展示了ServerProxy.send方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: do_download

# 需要导入模块: from xmlrpc.client import ServerProxy [as 别名]
# 或者: from xmlrpc.client.ServerProxy import send [as 别名]
 def do_download(self,arg):
     '''
     Used to make the Node find a file and download it.
     '''
     # client_url is the URL of the client which has file.
     if LOGIN:
         file_name=input('Input the file name: ')
         client_url=self._search(file_name)
         try :
             client=ServerProxy(client_url)
             self._fetch(file_name,client.send(file_name))
             print('Download success.')
         except:
             print('Cannot find file')
     else:
         print('Did not log in,please log in first ')
开发者ID:byebyebymyai,项目名称:P2P-Files-Sharing-System,代码行数:18,代码来源:Client.py

示例2: download

# 需要导入模块: from xmlrpc.client import ServerProxy [as 别名]
# 或者: from xmlrpc.client.ServerProxy import send [as 别名]
    def download(self):
        '''
        Used to make the Node find a file and download it.
        '''
        # client_url is the URL of the client which has file.
        global START

        if START:
            if LOGIN:
                file_name=self.fileName.get()
                if file_name == '':
                    self.onFileError()
                else:
                    client_url=self._search(file_name)
                    try :
                        client=ServerProxy(client_url)
                        self._fetch(file_name,client.send(file_name))
                        self.text.insert(INSERT,'Download success.\n')
                    except:
                        self.text.insert(INSERT,'Cannot find file.\n')
            else:
                self.onLogOutError()
        else:
            self.onStartError()
开发者ID:byebyebymyai,项目名称:P2P-Files-Sharing-System,代码行数:26,代码来源:GUIClient.py

示例3: echo_handler

# 需要导入模块: from xmlrpc.client import ServerProxy [as 别名]
# 或者: from xmlrpc.client.ServerProxy import send [as 别名]
    while True:
        c, a = s.accept()
        echo_handler(c)

echo_server( ('', 18000))

#
#client code
from socket import socket, AF_INET, SOCK_STREAM

secret_key = b'peekaboo'

s = socket(AF_INET, SOCK_STREAM)
s.connect( ('localhost', 18000))
client_authenticate( s, secret_key)
s.send(b'Hello Workd')
#11 


# EX 11-10

from socket import socket, AF_INET, SOCK_STREAM
import ssl

KEYFILE = 'server_key.pem'  #Private key of the server
CERTFILE = 'server_cert.pem'#Server certificate (given to client)

def echo_client(s):
    while True:
        data = s.recv(8192)
        if data == b'':
开发者ID:dodo99,项目名称:PythonCookbookExamples,代码行数:33,代码来源:chapter_11.py


注:本文中的xmlrpc.client.ServerProxy.send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。