---
title: "W5300 TCP Server Socket stuck at SOCK_SYNRECV state and time out"
url: "https://maker.wiznet.io/forum/13577"
markdown_url: "https://maker.wiznet.io/forum/13577/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Watercub3"
created: "2019-11-20T10:42:02+09:00"
last_activity: "2019-11-21T06:32:40+09:00"
language: "en"
views: 650
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5300 TCP Server Socket stuck at SOCK_SYNRECV state and time out

## Question

Asked by Watercub3 on 2019-11-20 in Ethernet Chips.

Hello there.
I am using FPGA to control W5300, which works as a TCP server. When I create a TCP client using MATLAB on my PC and try connect to W5300, the state of W5300 TCP socket switches from SOCK_LISTEN to SOCK_SYNRECV, then it is stuck until timeout and finally closed. How can I solve this problem? Any information is appreciated.

Additional info:

W5300 (SERVER) IP: 10.249.178.28; PORT NUM: 30000
PC (client) IP: 10.249.178.71;
Subnet mask: 255.255.248.0

Client and server connect through an Ethernet switch.

## Replies

### Reply 1 by becky, 2019-11-21

Hello,
Connect process in TCP is as below. The SOCK_SYNRECV state means that a SYN is received from the client. If timeout occurs, it means that ACK is not received from client. Please check your client once more.
Client ---------------------- Server
SYN ---------------------->
&lt;--------------------- SYN, ACK
ACK ---------------------->

### Reply 2 by Watercub3, 2019-11-21 (in reply to reply 1)

Thanks Becky!
I understand that something is wrong with the connection. It is funny that if I connect W5300 directly with my PC, connection can be successfully established. Maybe the problem is related to the switch.

---

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