---
title: "W5500 / W6100 Interrupt reason"
url: "https://maker.wiznet.io/forum/15646"
markdown_url: "https://maker.wiznet.io/forum/15646/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "JavorWM"
created: "2025-03-18T22:03:52+09:00"
last_activity: "2025-03-28T14:35:41+09:00"
language: "en"
tags: ["STM32"]
views: 5
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 / W6100 Interrupt reason

## Question

Asked by JavorWM on 2025-03-18 in Ethernet Chips.

Hello.

I test W5500 and W6100 with interrupt with the official library. I have a listening socket (in my case socket 3) on a port.

Everything works fine except, when I enter the interrupt handler, I don't know the reason causing the interrupt, the interrupt source (result from function wizchip_getinterrupt()) has a value of 0x0800, which corresponds to IK_SOCK_3 (1 &lt;&lt; 11) in wizchip_conf.h. How can I get the reason for the interrupt, i.e. client connected, client sent packet, client disconnected, etc... In W5100 documentation it's said that read interrupt value is 1 &lt;&lt; 2, which is reserved for W5500. I need to get all the states when client connects.

Also another problem: when client disconnects, it cannot connect anymore. Do I have to to initialize server socket again after client disconnects?

Thanks in advance.

Regards,

Javor

## Replies

### Reply 1 by JavorWM, 2025-03-19

After server closes client socket connection, for example using close(3), Sn_IR_DISCON is never called. How can this be handled?

### Reply 2 by louis_m, 2025-03-28

Fetches and processes all state when a client connects.

If you check the attached loopback example code, it recreates the socket in the SOCK_CLOSED state.

<https://github.com/Wiznet/ioLibrary_Driver/blob/8af15390e6563ff29a82cafa1e85018c0b79e3f5/Application/loopback/loopback.c>

---

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