How to tune azure netxduo to receive more incoming connections?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-01 04:25 AM
Hello,
I am using the stm32h563 processor in my project. I made a TCP Server application using the ethernet connections of this processor and I was able to run it as I wanted. But I saw that it could not connect to another client over the same IP address without breaking the connection with one client. Even though I set the NX_MAX_PHYSICAL_INTERFACES defined value to two, there was no change. Also, in the files I shared, it is said that we can make a tcp server and 2 tcp client connections and open a separate socket for each (1).
After some research, I realized that this problem can be solved with lwip + freertos. Below are examples of these solutions. How can I make a similar solution on Azure RTOS Netx side?
Our problem with lwip + freertos solved community issue(2) was previously shared and the solution was "By tweaking the options in lwipopts.h, it should be possible to receive more incoming connections: MEMP_NUM_TCP_PCB, MEMP_NUM_TCP_PCB_LISTEN, MEMP_NUM_NUM_NETCONN, etc... " was returned as ".
As a similar header you can see the extension(3) under the References header.
References:
(1)Understand Azure RTOS NetX Duo | Microsoft Learn
(2)Solved: How to tune LwIP to receive more incoming connecti... - STMicroelectronics Community
(3) I hope to achieve one-to-many connections using TC... - STMicroelectronics Community
Best Regards
Eren Akyol
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-25 11:02 PM
Hello @STea ,
First of all, thank you very much for your help. In the example you provided, 2 different clients can connect to 2 different ports with the same IP. Actually, what I've been trying to explain from the beginning is that 2 different clients should be able to connect to a single port with the same IP. Do you have any suggestions for this?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-26 08:54 AM
Hello @Eakyo.1 ,
To allow multiple clients to connect to a single server port, you typically use a single listening socket that accepts incoming connections. Each accepted connection is then handled by a separate socket. This is a common pattern in TCP server design. is this what you are trying to do?
In that case you need to:
-
Create a Listening Socket: This socket listens for incoming connection requests on the server port.
-
Accept Connections: When a client attempts to connect, the server accepts the connection, which creates a new socket specifically for communicating with that client.
-
Handle Client Communication: The server communicates with the client using the newly created socket. This communication is often handled in a separate thread or by using asynchronous I/O to allow the main listening socket to continue accepting new connections.
-
Manage Multiple Connections: If you want to handle multiple connections simultaneously, you can create a new thread for each accepted connection, or you can use a select/poll mechanism to manage multiple sockets within the same thread.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-27 09:56 AM - edited ‎2024-06-27 09:59 AM
Hello @Eakyo.1 ,
I've prepared a small template file app_netxduo.c from which I was able to send data with multiple clients on the same IP address and port.
Find attached the template File and confirm if this what you need to do.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-02 07:34 AM
- « Previous
-
- 1
- 2
- Next »