Paketage Spiling

    sk.send(b'123)

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

    sk.seng(b'456)

    possible:>>>b'123456

    ture is >>>b'123

              >>>b'456

Coding

PY3:(Str,Bytes)

str:unicode >>>>(encoding)['utf8']>>>>>>>>byte

byte:hexdecimal>>>>>(decoding)['utf8']>>>>>>>>str

s = 'hello,world'  # class of str is encoded with unicode
b1 = s.encode('utf8') # encode the str obj with utf8 and b1 is a byte value with encoding by utf8
print(b1)
b2 = bytes(s,'utf8') # convert the str obj(s) to byte obj(b2) by utf8 encoding form
print(b2)

s1 = b1.decode('utf8')
print(s1)
s2 = str(b2,'utf8')
print(s2)

########三次握手##########

IP >>>>>>>>Port>>>>>>>>>>Tcp/Udp

family=AF_INET/AF_UNIX

type=SOCK_STREAM/SOCK_DGRAM

server>><<<<<>(soket)>><<<<<>>client

Rece------Send

 while len(Rmessage) != DateLenth:
        Rmessagee = sk.recv(1024)
        Rmessage+= Rmessagee

  

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄