- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
i want to ask you a question about wiced_tcp_listen(socket,port). i have created two socket for my application. However, by using wiced_tcp_listen function i want to listen two socket with same port. When i start to compile i have encountered error. if i change port number. There is no error. Do you have any suggestion related with this issue.
Best Wishes
- Labels:
-
SDK 3.x
-
TCPIP
-
Web Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry it is not clear what you are trying to do. What is the compile error you have?
Either way it is not possible to have to sockets or apps listening to the same port. In TCP/IP or in general in the protocol stack only one listener may bind to one socket per protocol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you understand correctly that is what i want to ask
So in my application i am listening only one port also i open and a socket for each application. For example 1333. port is my main port that listens all device on 1333 port. i also assign port and socket for each device without disconnecting. assume i have 3 device, i open 1334,1335,1336 ports for devices. This ports are always open and i only send data from ports. i am looking for a way such that opening only one port for all devices not the number of devices.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So what you want to do is the listen on only one port as a server
The devices will make connections to this port as clients and the connection would have the same server port but different client port to have a unique 5-tuple
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
engin.875 wrote:
Yes, you understand correctly that is what i want to ask
So in my application i am listening only one port also i open and a socket for each application. For example 1333. port is my main port that listens all device on 1333 port. i also assign port and socket for each device without disconnecting. assume i have 3 device, i open 1334,1335,1336 ports for devices. This ports are always open and i only send data from ports. i am looking for a way such that opening only one port for all devices not the number of devices.
Thanks
I think wiced_tcp_server_start() is the API you are looking for.
You can reference the http_server.c to use this API.