LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Server Client Communication problem in other systems

Solved!
Go to solution

hai everyone iam developing a software which would communicate between Server and client using TCP in labview...it works fine in my network...but when i try to run my client from my friend's system there is no communication between client and server...what would be the problem..??is there any solution for this..?? Thanks in Advance...

0 Kudos
Message 1 of 7
(1,198 Views)

At least 95% of times, it's a firewall problem. Or maybe the port number is already used. Or your timeouts are not appropriate for the other network. Or there is a bug in your code. Or... etc. etc.

You need to give us more details. Could you post your code? You get any error? Are you running in a LAN or over Internet?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 7
(1,184 Views)

hai Paolo, thanks for your reply iam using internet ...i have tried turning off all my firewall it doesnt worked for me...and there is no bug in my code because it works fine when i run client in my system...

0 Kudos
Message 3 of 7
(1,168 Views)

 


@rathish12  ha scritto:

...and there is no bug in my code because it works fine when i run client in my system...


This does not imply that the program is not buggy. Internet and LAN represent different use cases...

 

You still don't give enough details. How do you expose your Server to the Internet? Usually, this implies setting up a port forwarding rule in the router.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 7
(1,163 Views)
Solution
Accepted by topic author rathish12

@rathish12 wrote:

hai Paolo, thanks for your reply iam using internet ...i have tried turning off all my firewall it doesnt worked for me...and there is no bug in my code because it works fine when i run client in my system...


Well claiming to not have any bug in your code is a very bold statement. Usually as you grow more proficient with programming you will be much less inclined to claim that! 😁

 

And using internet is not at all like your local LAN network. While you can see the internet from your LAN, the internet can VERY hopefully not see your computer on your LAN at all by default. If it could be visible from the internet it would be under attack within minutes from being powered on!

 

If you want to make a server application available to someone outside your own LAN you have to explicitly configure a port forwarding rule in your router (ADSL modem or whatever you use to connect your LAN to the internet). Basically there has to be a rule in the router that forwards a specific port number on the public facing router interface to the LAN internal IP address of your computer and the port number of your server. The two port numbers can but don't necessarily need to be the same.

 

Your friend then has to enter the public IP address of your router, and the port number you configured in the port forwarding to try to connect to your server. This can be extra challenging depending on your internet provider since not all internet providers use fixed IP addresses for their clients, since IPv4 addresses are a scarce commodity nowadays. If your internet provider uses dynamic IP addresses you will also have to use a service like DynDNS or similar which you can use to register your current dynamic IP address under your own DynDNS domain name or whatever service you use. Your friend then will have to enter that domain name as address instead of an IP address.

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 7
(1,152 Views)

@rolfk wrote:

@rathish12 wrote:

hai Paolo, thanks for your reply iam using internet ...i have tried turning off all my firewall it doesnt worked for me...and there is no bug in my code because it works fine when i run client in my system...


Well claiming to not have any bug in your code is a very bold statement. Usually as you grow more proficient with programming you will be much less inclined to claim that! 😁

 

And using internet is not at all like your local LAN network. While you can see the internet from your LAN, the internet can VERY hopefully not see your computer on your LAN at all by default. If it could be visible from the internet it would be under attack within minutes from being powered on!

 

If you want to make a server application available to someone outside your own LAN you have to explicitly configure a port forwarding rule in your router (ADSL modem or whatever you use to connect your LAN to the internet). Basically there has to be a rule in the router that forwards a specific port number on the public facing router interface to the LAN internal IP address of your computer and the port number of your server. The two port numbers can but don't necessarily need to be the same.

 

Your friend then has to enter the public IP address of your router, and the port number you configured in the port forwarding to try to connect to your server. This can be extra challenging depending on your internet provider since not all internet providers use fixed IP addresses for their clients, since IPv4 addresses are a scarce commodity nowadays. If your internet provider uses dynamic IP addresses you will also have to use a service like DynDNS or similar which you can use to register your current dynamic IP address under your own DynDNS domain name or whatever service you use. Your friend then will have to enter that domain name as address instead of an IP address.

 


I agree.  To put it simply, the two PCs, the two modems, any routers, and any ISPs involved are all working very hard to prevent what the OP is trying to do.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 7
(1,142 Views)

Thanks for the reply buddy....after many search i have found that port forwadding is the way to overcome this problem.. since am using a hotspot of my mobile to connect ....i have used something called ngrok for forwadding the request to my local port ...now its working perfectly out of my network....may i know how efficient this would be in comparing to normal port forwadding??

0 Kudos
Message 7 of 7
(1,126 Views)