01-18-2021 01:47 AM
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...
Solved! Go to Solution.
01-18-2021 02:09 AM
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?
01-18-2021 04:07 AM
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...
01-18-2021 04:22 AM
@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.
01-18-2021 06:00 AM
@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.
01-18-2021 07:35 AM - edited 01-18-2021 07:36 AM
@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.
01-18-2021 10:12 PM
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??