Have you got windows firewall (or other firewall software) turned on? That sort of error normally means that there is nothing listening on the specific ip address and port, or that the connection is being prevented due to firewalls etc.

 

You can see if other applications can establish a connection to your listener by trying telnet, run a command prompt and enter ‘telnet <ipaddress> <port>’ and see if you get a blank screen with a cursor, this means you have connected to your listener. E.g. “telnet 192.168.0.1 8000”

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of mona shokrof
Sent: 22 September 2005 12:14
To: csharp ms; [EMAIL PROTECTED]
Subject: [Microsofts_C_Sharp] help in socket programming

 

hi every body

 

i have a problem in socket programming

i am using c#

 

i am making a small application using tcplistener and tcpclient

 

i start the listener successfully

 

but when i open the client form

it gives me an exception

 

it's messege is

 "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" 

 

and it's error   10060

 

i though it may be the port or sth

 

but when i changed it it gives the same exception

 

and also if the listener is not started it gives the same exeption

 

this is the code of the client

 

sr = new StreamReader(new FileStream("IP.txt",FileMode.Open,FileAccess.Read));

string ipad = sr.ReadLine();

Cilent = new TcpClient(ipad,8000); //here it gives the exception

sr.Close();

 

the stream reader has no problems

it reads the ip address correctly

i am just trying both applications on the same pc

 

i am sorry 4 this long mail

 

thnx in advance

 

bye

 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


SPONSORED LINKS
Basic programming language C programming language Computer programming languages
Programming languages C programming language Software programming language


YAHOO! GROUPS LINKS




Reply via email to