lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Sharing TCP port


From: Danish Ali
Subject: Re: [lwip-users] Sharing TCP port
Date: Tue, 16 Mar 2021 15:26:33 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

Thanks for your response, Simon. But I fear we are talking at cross-purposes.

I already have working code with LWIP being the server on 5060, and accepting multiple simultaneous TCP links that remote devices call into LWIP.

So I think I have already done your suggestion of

1 listener -> accept -> multiple connection sockets?


But now I want to be able, at the same time, to have LWIP make connections _from_ its TCP port 5060 _to_ other, different and currently unconnected, remote devices.

So the local port is always 5060. And I have one netconn listening for incoming TCP connection attempts from any IP-address. And each fresh incoming TCP gets assigned to a fresh netconn. And this works.

Now how do I set up a netconn to be coming from 5060 and going to a specified new IP-address:port (for which I don't have an open link)?

I might add that I come from a "bare metal" microcontroller background rather than a Unix sockets background. I don't know how one would write it for sockets. I have tried to look (for example) at the pjsip source-code and that does not seem to assign the port number for its outgoing TCP connections.

Is this something that should be possible? Do you have a link that might give me a clue (even if it is written for sockets rather than netconn?)

Regards,
Danish

Message: 2
Date: Mon, 15 Mar 2021 16:23:34 +0100
From: "goldsimon@gmx.de" <goldsimon@gmx.de>
To: Mailing list for lwIP users <lwip-users@nongnu.org>
Subject: Re: [lwip-users] Sharing TCP port
Message-ID: <b5a5a3bc-07a1-5ca0-dce2-6b2a09da13d3@gmx.de>
Content-Type: text/plain; charset=utf-8

Am 15.03.2021 um 16:15 schrieb Danish Ali:
I would like to be able to have multiple simultaneous TCP links to a
single port (in my case 5060 for SIP).

Try to write the same thing for standard sockets. If you know that API,
transforming the code to use the netconn API pretty simple.

And for sockets, there are *much* more exampes and places to ask.

I assume what you're missing is: 1 listener -> accept -> multiple
connection sockets?

Regards,
Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]