---
title: "W5500 UDP Clearing RX and TX data"
url: "https://maker.wiznet.io/forum/13741"
markdown_url: "https://maker.wiznet.io/forum/13741/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "AndrewBubble"
created: "2020-03-13T20:00:20+09:00"
last_activity: "2020-03-17T10:03:55+09:00"
language: "en"
views: 488
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 UDP Clearing RX and TX data

## Question

Asked by AndrewBubble on 2020-03-13 in Ethernet Chips.

Hi I have a question concerning the resetting or clearing of the RX and TX data after a UDP message send or receive.

I have read through the several examples but at present I am closing and opening the socket after a UDP send.

I can receive a UDP message with no problem but I cannot see what is the correct sequence to clear the RX data, pointers and receive bytes ready for the next message without closing or opening a socket.

I assume this is not correct, can anyone help

Regards Andrew

## Replies

### Reply 1 by becky, 2020-03-17

I don’t understand your question.
When receiving data, check the value of Sn_RX_RSR and if it is greater than 0, read Sn_RX_RD to find the pointer address of data, and then read data as much as Sn_RX_RSR. Then, increase the value to Sn_RX_RD as much as read data and transmit the RECV command.
You just need to read Sn_RX_RD every time you receive data, and you don’t need to prepare for the next message.

---

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