Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi everyone,
I have created a application for transferring files using TCP/IP socket communication.Now i want to add a feature that checks TCP/IP coonection to remote server on specific port number(whether its available or not for transfer).So,Kindly any one help me in this.Thanks in advance.
Herman<T>.Instance 17-Jun-14 5:47am    
read about TcpClient

1 solution

There are several ways, one of them is pinging an address every few minutes to insure the network is still up.
You can also use GetIsNetworkAvailable method in System.Net.NetworkInformation.NetworkInterface.
Even a better solution which you can use if the NetworkChange class and its 2 events:

More info fro MSDN here[^]
Share this answer
johannesnestler 17-Jun-14 9:30am    
good tip, but has nothing todo with op's problem - he asks for checking PORTS.. - But I didn't vote...
Sprint89 17-Jun-14 10:15am    
I don't think you can ping a port

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900