about timeout connect() w5500

hello, im new user. Im using w5500 and stm32 as client to connect to my laptop. i read data by hercules. But when im debugging the program, it stopped at " code = connect(http_socket, addr, 5354);" and return TIMEOUT. I checked server ip and its correct, I don’t know what went wrong. This is my code:
void init() {
wiz_NetTimeout timeout = {
.retry_cnt = 3, //RCR = 3
.time_100us = 5000};
wiz_NetTimeout tmpTimeout;
UART_Printf(“\r\ninit() called!\r\n”);
UART_Printf(“Registering W5500 callbacks…\r\n”);
reg_wizchip_cs_cbfunc(W5500_Select, W5500_Unselect);
reg_wizchip_spi_cbfunc(W5500_ReadByte, W5500_WriteByte);
ver = getVERSIONR();
UART_Printf(“Calling wizchip_init()…\r\n”);
uint8_t rx_tx_buff_sizes = {2, 2, 2, 2, 2, 2, 2, 2};
wizchip_init(rx_tx_buff_sizes, rx_tx_buff_sizes);

wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef}, // Mac address
												.ip = {198, 168, 1, 90}, // IP address
												.sn = {255, 255, 255, 0}, // Subnet mask
												.gw = {192, 168, 1, 100}}; // Gateway address

uint8_t dns[4] = {8, 8, 8, 8};
UART_Printf("IP:  %d.%d.%d.%d\r\nGW:  %d.%d.%d.%d\r\nNet: %d.%d.%d.%d\r\nDNS: %d.%d.%d.%d\r\n",
		netInfo.ip[0], netInfo.ip[1], netInfo.ip[2], netInfo.ip[3],
		netInfo.gw[0], netInfo.gw[1], netInfo.gw[2], netInfo.gw[3],
		netInfo.sn[0], netInfo.sn[1], netInfo.sn[2], netInfo.sn[3],
		dns[0], dns[1], dns[2], dns[3]
);
UART_Printf("Calling wizchip_setnetinfo()...\r\n");
wizchip_setnetinfo(&netInfo);
    ctlnetwork(CN_SET_TIMEOUT,(void*)&timeout);
ctlnetwork(CN_GET_TIMEOUT, (void*)&tmpTimeout);
uint8_t addr[4] = { 192,168,88,171};
UART_Printf("Creating socket...\r\n");
uint8_t http_socket = HTTP_SOCKET;
int8_t code = socket(http_socket, Sn_MR_TCP, 5656,  SF_TCP_NODELAY);
if(code != http_socket) {
		UART_Printf("socket() failed, code = %d\r\n", code);
		return;
}
UART_Printf("Socket created, connecting...\r\n");
code = connect(http_socket, addr, 5354);
if(code != SOCK_OK) {
		UART_Printf("connect() failed, code = %d\r\n", code);
		close(http_socket);
}

}

A number of reasons. 192.168.88.171 is located in different subnetwork - and communication will involve gateway, so you must have its IP address set up properly and have it properly functioning. Port 5354 may not be listened to.
The cause for timeout is W5500 not able to communicate with the target device or another device (router/gateway) about target device.

i checked ip with command prompt
cmd: netstat -a -n
TCP 169.254.185.191:139 0.0.0.0:0 LISTENING

cmd : ipconfig
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::c0fb:bdf4:8d90:876e%13
Autoconfiguration IPv4 Address. . : 169.254.185.191
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 192.168.0.45
i try using this ip “169.254.185.191” but it is not work, connection() returned SOCKERR_SOCKCLOSED. Why???

Link-local address - Wikipedia
What are you doing? First original post was clear, this second one is completely out of blue.

I mean I see you’re right and checked the connections again with the command prompt, I realized the ip address 192,168,88,171 is the address that the laptop uses in the Wireless LAN adapter Wi-Fi network so I tried switching to the address. The ip address is 169,254,185,191 which is the address the laptop uses to connect, and connects to port 139. I checked and found the port is in “listening” state but I still can’t connect.

I think you have PC configuration issue. It should have valid gateway but bad IP address. Check its interface settings. Start with W5500 and PC being in the same network and see if it works.