Read up to size bytes from the socket. Return a bytes object. If size is not given, it reads all data available from the socket until EOF; as such the method will not return until the socket is closed. This function tries to read as much data as requested (no “short reads”). This may be not possible with non-blocking socket though, and then less data will be returned.
#### **socket.readinto**(buf[, nbytes])
Read bytes into the buf. If nbytes is specified then read at most that many bytes. Otherwise, read at most len(buf) bytes. Just as read(), this method follows “no short reads” policy.
Return value: number of bytes read and stored into buf.
#### **socket.readline**()
接收一行数据,遇换行符结束,并返回接收数据的对象 。
#### **socket.write**(buf)
将字节类型数据写入套接字,并返回写入成功的数据大小。
### 示例
#### TCP Server example
```
>>> import usocket
>>> s = usocket.socket(usocket.AF_INET,usocket.SOCK_STREAM) # Create STREAM TCP socket
>>> s.bind(('192.168.12.32', 6001))
>>> s.listen(5)
>>> s.setblocking(True)
>>> sock,addr=s.accept()
>>> sock.recv(10)
b'rt-thread\r'
>>> s.close()
```
#### TCP Client example
```
>>> import usocket
>>> s = usocket.socket(usocket.AF_INET,usocket.SOCK_STREAM)