Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Images streaming using Indy client side
(05-06-2022, 10:01 AM)Ahmed Sayed Wrote: Ok, I read some about TCP/UDP hole punching and I have seen some people asking about it on stack-overflow but I don't understand how to implement it in Indy? Regardless of the protocol HTTP/TCP/UDP.

Sorry, I can't answer that.

(05-06-2022, 10:01 AM)Ahmed Sayed Wrote: I assume that these ports used in the apps are local ports and are not public and can't be reach from the public internet that's why both apps will not be able to connect to each other unless I open ports on both routers and map them to the local ports then use these public ports instead.


(05-06-2022, 10:01 AM)Ahmed Sayed Wrote: I am not planning on making a TIdTCPClient connect to another TIdTCPClient here, in fact I want this to be easy as possible. I wanna use a normal connection between a client and a server on both sides.

Unless you can figure out how to make the hole punching work, then you will just have to configure port forwarding in one of the NAT routers, and have the other PC act as the client that connects to that router.

(05-06-2022, 10:01 AM)Ahmed Sayed Wrote: How can I get the public port?

The public port will have to be published somewhere that you can query it, or the user will have to enter it manually.

Quote:Sorry, I can't answer that.


At least can you tell me how to query the public port using Indy TCP components? And I will figure out the rest on my own.
(05-07-2022, 02:13 AM)Ahmed Sayed Wrote:
Quote:Sorry, I can't answer that.


Because I don't have an answer to provide. I've personally never needed to punch a hole between 2 NATs, so I can't explain to you how to implement it in practice. Even without using Indy, using just plain socket APIs, it is still difficult to implement by hand. There are technical documents floating around that explain the theory.

(05-07-2022, 02:13 AM)Ahmed Sayed Wrote: At least can you tell me how to query the public port using Indy TCP components?

There is no standard protocol to perform that query, and certainly nothing built-in to Indy to perform it. It is the responsibility of the NAT router to publish it somewhere, such as on a webpage, or a uPNP endpoint, or somewhere else that an app can access programmably. A better option is if your own code is opening the public port to begin with, ie via uPNP, then you will know the port up front and there is nothing to query. But Indy has no uPNP components, so you will have to use platform-specific APIs for that, or 3rd party uPNP libraries.


Forum Jump:

Users browsing this thread: 1 Guest(s)