---
title: "Invalid socket error"
url: "https://maker.wiznet.io/forum/14117"
markdown_url: "https://maker.wiznet.io/forum/14117/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "rupesh raghatate"
created: "2021-01-12T14:12:49+09:00"
last_activity: "2021-01-27T06:08:51+09:00"
language: "en"
views: 657
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Invalid socket error

## Question

Asked by rupesh raghatate on 2021-01-12 in Ethernet Chips.

Dear all,
I am using W5500 with Stm32 controller,
I have downloaded IO library,
I am able to ping my module from computer,
But when I try to connect to TCP server running on pc using send() function
It returns -5 error .
Unable to figure out what is happening,
Can any one help …

## Replies

### Reply 1 by irina, 2021-01-27

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/81b598977823cc38519c8de5834995bdea5032f5.png) image846×344 28.9 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/81b598977823cc38519c8de5834995bdea5032f5.png)

This error code is Invalid socket mode of socket operation.
You can check the value of getSn_MR and used socket function.
If you use the TCP client using W5500, you cab use the function of socket, connect, send, recv.
Please refer the loopback of appplication.

[ioLibrary_Driver/loopback.c at master · Wiznet/ioLibrary_Driver (github.com)](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Application/loopback/loopback.c)

---

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