Sim IJskes - QCG wrote:
On 10-07-11 06:37, Peter wrote:
Any suggestions, ideas or assistance is welcome.
A ServerEndpoint needs to know its external contact identity. In case
of the TcpServerEndpoint the hostname where the client needs to
connect to.
Correct, that would be the publicly visible address and port.
A ServerEndpoint behind a NAT probably has a private net address/
hostname.
Correct, clients on the net need a public address.
Where do you connect to the proxy server to fetch the external address?
It would require a custom ServerSocketFactory, so that when a Service is
exported using a ServerEndpoint, during the export process, a port is
opened on the NAT, either by using NAT-PMP, UPnP-IGD or a STUN server.
This external port would need to be kept alive, by maintaining a
connection to the STUN server while the services is exported. It is
this publicly visible address that the proxy Endpoint will attempt to
contact, though it's custom Socket.
The question remains though, how would another client contact the
ServerEndpoint if it is also behind the NAT, interestingly I'm able to
contact a computer from inside my network, by using an external NAT'd
port on my router, that connects back to my internal network. I don't
know if this is the same for all NAT's.
UDT looks very interesting, in effect many UDTSockets can share a single
DatagramSocket, so the identity question asked earlier includes an
additional identity which is the identity of the UDTSocket.
I guess this also needs a custom implementation of SocketAddress.
Cheers,
Peter.