---
title: "w5500 halted in send or receive socket"
url: "https://maker.wiznet.io/forum/14367"
markdown_url: "https://maker.wiznet.io/forum/14367/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "pistoletov1974"
created: "2021-10-20T08:05:45+09:00"
last_activity: "2021-10-25T08:16:32+09:00"
language: "en"
views: 583
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# w5500 halted in send or receive socket

## Question

Asked by pistoletov1974 on 2021-10-20 in Ethernet Chips.

Hi! I use iolibrary from wiznet and approximately one time a week code halted in send or receive routines i suppouse socket state does not change bu why?

> while(1)
> {
> freesize = getSn_TX_FSR(sn);
> tmp = getSn_SR(sn);
> if ((tmp != SOCK_ESTABLISHED) && (tmp != SOCK_CLOSE_WAIT))
> {
> close(sn);
> return SOCKERR_SOCKSTATUS;
> }
> if( (sock_io_mode & (1&lt;&lt;sn)) && (len > freesize) ) return SOCK_BUSY;
> if(len &lt;= freesize) break;
>
> }

My payload have 50 bytes maximum size. I cant understand what happened. I suppouse connection broke when socket begin send o receive data.

## Replies

### Reply 1 by louis, 2021-10-25

Hi,

May I know how the socket doesn’t change?

First of all, I’ll attach the WIZnet library we’re providing. This code works well without errors.

The chords might be tangled, so I recommend you porting the io library again.

Thank you.

### Reply 2 by pistoletov1974, 2021-10-25 (in reply to reply 1)

Thank you for the reply, @louis.I attache the wireshark screenshot. May be this help to resolve situation.
10.8.9.103 is ip of wizznet board. Because errors ocured very rarely is too hard to discover problem.

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5f3a639e3f22482ad2a9572f182b7f7c73e74176.png) image1933×535 56.2 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5f3a639e3f22482ad2a9572f182b7f7c73e74176.png)

---

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