0xlny / tcpholepunching

Simple basic tcp hole punching between 2 clients and a mediator
36 stars 16 forks source link

Is this part correct? #1

Open ksp7518 opened 1 year ago

ksp7518 commented 1 year ago

Hello, Dear

ClientA and B have different code below.

A) proceedHolePunching(InetAddress.getByName(tokens[3].trim()), Integer.parseInt(tokens[1].trim()), Integer.valueOf(tokens[2])); B) proceedHolePunching(InetAddress.getByName(tokens[3].trim()), Integer.parseInt(tokens[5].trim()), Integer.valueOf(tokens[4]));

It seems that mistake. I tried fixing it but it doesn't work.

ksp7518 commented 1 year ago

I fixed as below. It's works Thank you.

... socketClientPunch = new Socket(ip, tcpPunchPort);
myLocalport = socketClientPunch.getLocalPort(); //ksp ... proceedHolePunching(InetAddress.getByName(tokens[3].trim()), Integer.parseInt(tokens[5].trim()), myLocalport); //ksp