zoukankan      html  css  js  c++  java
  • msg = conn.recv(BUFSIZE) 一次程序能接收的最大数据

     msg = conn.recv(BUFSIZE) #接受消息的内容
    		 
    		 
    -----------------------
    <socket._socketobject object at 0x7fdd08d8cad0>
    ('192.168.137.1', 57504)
    接到来自192.168.137.1的链接
    -----------------------
    123456789
    -----------------------
    -----------------------
    0
    -----------------------
    
    客户端发送
    s.send('1234567890') 10位数字
    
    Receive data from the socket. The return value is a string representing the data received.
    
     The maximum amount of data to be received at once is specified by bufsize.
    
     See the Unix manual page recv(2) for the meaning of the optional argument flags; it defaults to zero.
    
    Note For best match with hardware and network realities, the value of bufsize should be a relatively small power of 2, for example, 4096.
    
    从socket接收数据,返回值是一个字符串反应接收的数据。
    
    通过设置bufsize 表示一次能接收的最大数据
  • 相关阅读:
    2019牛客多校第二场H题(悬线法)
    hdu6212 Zuma(区间dp)
    uva1428树状数组
    UVA1395 (最苗条的最小生成树)
    牛客练习赛53 C题bitset
    Love Live!
    Princess principal
    New Game!- 牛客
    P3311 [SDOI2014]数数
    [HNOI2008]GT考试
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348537.html
Copyright © 2011-2022 走看看