Fork me on GitHub
01 2020 档案
UDP套接字协议
摘要:服务端 # from socket import * # server=socket(AF_INET,SOCK_DGRAM) # server.bind(('127.7.8.9',7890)) # while True: # data,client_addr=server.recvfrom(1024 阅读全文
posted @ 2020-01-04 18:28 OBOS 阅读(373) 评论(0) 推荐(0)
文件处理客户端
摘要:import socket,struct,json,os DOWNLOAD_DIR=r'D:\python13期\网络编程\文件处理\DOWNLOAD' class FtpClient: def __init__(self,host,port): self.host=host self.port=p 阅读全文
posted @ 2020-01-03 20:23 OBOS 阅读(137) 评论(0) 推荐(0)
文件处理服务端
摘要:import socket,os,json,struct SHARE_DIR=r'D:\python13期\网络编程\文件处理\SHARE' class FtpServer: def __init__(self,host,port): self.host=host self.port=port se 阅读全文
posted @ 2020-01-03 20:21 OBOS 阅读(182) 评论(0) 推荐(0)
解决粘包问题2客户端
摘要:from socket import * import struct,json client=socket(AF_INET,SOCK_STREAM) client.connect(('127.2.2.2',6688)) while True: cmd=input('>>:').strip() if 阅读全文
posted @ 2020-01-03 17:56 OBOS 阅读(133) 评论(0) 推荐(0)
解决粘包问题2服务端
摘要:from socket import * import subprocess,struct,json server=socket(AF_INET,SOCK_STREAM) server.bind(('127.2.2.2',6688)) server.listen(5) while True: con 阅读全文
posted @ 2020-01-03 17:55 OBOS 阅读(143) 评论(0) 推荐(0)
解决粘包问题1客户端
摘要:# from socket import * # client=socket(AF_INET,SOCK_STREAM) # client.connect(('127.2.2.2',6689)) # client.send('hello'.encode('utf-8')) # client.send( 阅读全文
posted @ 2020-01-02 20:24 OBOS 阅读(172) 评论(0) 推荐(0)
解决粘包问题1服务端
摘要:# from socket import * # server=socket(AF_INET,SOCK_STREAM) # server.bind(('127.2.2.2',6689)) # server.listen(5) # conn,addr=server.accept() # res1=co 阅读全文
posted @ 2020-01-02 20:22 OBOS 阅读(202) 评论(0) 推荐(0)
模拟远程执行ssh客户端
摘要:from socket import * client=socket(AF_INET,SOCK_STREAM) client.connect(('127.2.2.2',6688)) while True: cmd=input('>>:').strip() if not cmd:continue cl 阅读全文
posted @ 2020-01-02 18:48 OBOS 阅读(153) 评论(0) 推荐(0)
模拟远程执行ssh服务端
摘要:from socket import * import subprocess server=socket(AF_INET,SOCK_STREAM) server.bind(('127.2.2.2',6688)) server.listen(5) while True: conn,client_add 阅读全文
posted @ 2020-01-02 18:47 OBOS 阅读(230) 评论(0) 推荐(0)