Python Core Programming Note 2
Net Programming
1. TCP
- Server:
from socket import * |
- Client
from socket import * |
2. UDP
- Server
from socket import * |
- Client
from socket import * |
使用SocketServer
- Server
from socketserver import (TCPServer as TCP, StreamRequestHandler as SRH) |
- Client
不同之处:需要把建立和连接放在每次循环中
from socket import * |