---
title: "W5500 TCP - write to TX buffer before connection up"
url: "https://maker.wiznet.io/forum/11164"
markdown_url: "https://maker.wiznet.io/forum/11164/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "billbgarland"
created: "2015-07-08T14:44:37+09:00"
last_activity: "2017-05-04T08:36:19+09:00"
language: "en"
views: 846
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 TCP - write to TX buffer before connection up

## Question

Asked by billbgarland on 2015-07-08 in Ethernet Chips.

Hi

I am using the W5500 in a new design and it is working well. To send data over TCP I currently:

Open a TCP socket
Wait for the connection to come active
Write to the TX buffer
Issue a SEND command

This works fine but I would like to change the order to:

Open a TCP socket
Write to the TX buffer
Wait for the connection to come active
Issue a SEND command

When I tried this it did not work. Is there a way of writing to the TX buffer before the TCP connection is active?

Bill

## Replies

### Reply 1 by Coccoliso, 2015-07-09

The socket has to be connected.
You can not fill the TX buffer of a disconnected socket because you do not know in which location write … the two TX buffer pointers are updated only upon connection.

### Reply 2 by billbgarland, 2015-07-09

Hi Coccoliso

Can I do this:

Open a TCP socket
Write message to FIFO and save TX_WR pointers
Wait for the connection to come active
Modify TX_RD and TX_WR pointers to point to message in FIFO
Issue a SEND command

The reason I want to do this is that my host has very little RAM and I want to save my message in the W5500 FIFO.

### Reply 3 by Coccoliso, 2015-07-09

I do not remember the post but I’m pretty sure that the pointers contain 0 after reset but during the operations of opening of the socket containing two identical random values that are overwritten to the connection with the real value so I do not think that will work.
The buffers are used as random-access memory as long as the socket is connected.

---

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