4 Replies Latest reply on Apr 13, 2016 6:50 PM by AxLi_1746341

    TCP listen

    enel_2129601

      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

        • 1. Re: TCP listen

          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 

          • 2. Re: TCP listen
            enel_2129601

            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

            • 3. Re: TCP listen

              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

              • 4. Re: TCP listen
                AxLi_1746341

                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.

                1 of 1 people found this helpful