X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Ftcp_socket.c;fp=bertos%2Fnet%2Ftcp_socket.c;h=98e743ad46420105d48b66a9c7526dff274a5142;hb=91ed9541e2598d8edfe1a5eaa5908760ea1edb4c;hp=030f55f3351e50a7cb11ce0bb16bf3d50c03ddc2;hpb=e8b0472be10fba4ca6baa62d8d483db90e28c06e;p=bertos.git diff --git a/bertos/net/tcp_socket.c b/bertos/net/tcp_socket.c index 030f55f3..98e743ad 100644 --- a/bertos/net/tcp_socket.c +++ b/bertos/net/tcp_socket.c @@ -130,6 +130,15 @@ static KFile *tcpsocket_reopen(KFile *fd) return NULL; } +/* + * Read data from socket. + * + * The read return the bytes that had been received if they are less than we request too. + * Otherwise if the byte that we want read are less that the received bytes, we return only + * the requested bytes. To get the remaning bytes we need to make an others read, until the + * buffer is empty. + * When there are not any more bytes, a new read takes data from remote socket. + */ static size_t tcpsocket_read(KFile *fd, void *buf, size_t len) { TcpSocket *socket = TCPSOCKET_CAST(fd);