WIZnet Developer Forum

STM32 F401 / HTTP Client / GET requests / How to avoid open-close-openclose socket

Hi frinds!

I use the GET requests to the server.
I don’t like my code. My code is working but…
If I need to send the GET requests 3 times then I do:

– create socket
– Send GET
– recieve answer
– close socket

– create socket
– Send GET
– recieve answer
– close socket

– create socket
– Send GET
– recieve answer
– close socket

I want to open the socket for many GETs requests. How to do it?

Please see my code in attached file. I indicated the part which must work 1 time only.

Hello.

  1. Which product are you using?

  2. Do you want to open multiple sockets?

Thank you. I’ll answer that.

Hello

  1. I use w5500

  2. I don’t know. Please help. I need to send biq q-ty GET requests to one server. Do you recomend multiple sockets?

What does big q-ty mean?
Do I have to create sockets and send the data?

I’m curious what you’re trying to make it with.

Thank you.

Hi Louis!

I will explain you shortly.

Now I use algorithm:
Open socket / Send GET / Close socket + Open socket / Send GET / Close socket

I want to use the following algorithm:
Open socket / Send GET + Send GET + Send GET / Close socket

I will attach the example of LoopBack.

In the example, there is content SOCKET opens, closes, and sends data.

I think you can modify it according to your algorithm.

Thank you,

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.