Question

I need a library with simple API. Defining simple: perfect solution for me would be something like described here but addopted for crossplatform use in Java (crossplatform for me is stand alone desctop app for Win, Mac, Lin)... So how API I would like to see looks like? Like oneI have in C#:

using TCMPortMapper;

private void Form1_Load()
{
  PortMapper.SharedInstance.Start();
  PortMapping pm = new PortMapping(localPort, publicPort, 
         PortMappingTransportProtocol.TCP);
  PortMapper.SharedInstance.AddPortMapping(pm);
}
private void Form1_FormClosing()
{
  PortMapper.SharedInstance.StopBlocking();
}

What I plan to do with it? I want to create easy in use with Google App Engine free plan distributed (cloud like) file server that would be generaly based on my app users computers... so to say they use my app they houst it=)

Was it helpful?

Solution

I recommend you have a look at "Punching Holes with Java RMI, it might be helpful.

OTHER TIPS

I looked around and the most promising library I found was miniupnp. The official specs on how to do this are called UPnP IGD, and it's painfully complicated and nasty to read.

It should be possible to do this from Java, you need network capabilities, and sufficient privileges to send and receive UDP packets on special ports. I made a Python porting attempt that worked on my LAN, you might port that (it's a simplification of miniupnp). If you haven't taken the time to learn Python, I highly recommend it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top