---
title: "Clear TCP receive register"
url: "https://maker.wiznet.io/forum/15084"
markdown_url: "https://maker.wiznet.io/forum/15084/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Meysam Abb"
created: "2023-12-05T07:39:06+09:00"
last_activity: "2023-12-12T09:19:39+09:00"
language: "en"
views: 131
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Clear TCP receive register

## Question

Asked by Meysam Abb on 2023-12-05 in Ethernet Chips.

Dear community,
I have just started working with W5500 and now with the help of the provided library I can create a TCP server and send and receive data, but after receiving data the RX register is not cleared and the previous data with the new ones are combined. This is obvious when the length of the data is different. Of course, I don’t want to close the socket. Is there a function that I can call it to clear the receiving buffer? If so show me how to use it. And the next question is, I want to define the maximum RX buffer size to 2048 bytes, how do I do this? getSn_RXBUF_SIZE retuen me 2 . what is that means?

Thanks.

## Replies

### Reply 1 by Eugeny, 2023-12-05

Meysam_Abb:

> the RX register is not cleared and the previous data with the new ones are combined.

W5100 datasheet chapter 5.2.1.2

Meysam_Abb:

> getSn_RXBUF_SIZE retuen me 2 . what is that means?

W5500 datasheet chapter 3.3.

---

Source: https://maker.wiznet.io/forum/15084
