本文整理汇总了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 ')
示例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()
示例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'':