TcpClient unable to connect to a TcpListener

TcpClient unable to connect to a TcpListener

Post by VEJKX01pc3 » Thu, 22 Dec 2005 06:17:02


I have Cox high speed internet connection. The Cox cable goes into their box
(router). I then run a cable to my little in-house hub and two cables run
from my hub to my two XP boxes.
When I run ipconfig on box 1 I get an ip address of 192.168.0.102 and when I
run ipconfig on the other box I get 192.168.0.100 with a gateway of
192.168.0.1.
In the TCP/IP settings under the IP address tab I have - Obtain an IP
address automatically. I am running XP - SP2 on both boxes.
I have my TcpListener running on box 1 and my TcpClient running on box 2.
The TcpClient is unable to connect to the Listener program.
I have tried opening a port in the XP firewall. I also tried opening a
program - the XP firewall allows you to open either a port or a program. I
have tried both.
In the TcpClient Connect method I have used both the IP address and the
computer name. Nothing works. The connect call succeeds but when I got to
write I get an error.
I have tried using telnet as well to talk to my app but that doesn't work
either. Telnet seems to connect but when I go to write something I get no
response back and my server doesn't show being connected. When I use telnet I
can put in any bogus ip address and port and it always connects - I never get
"Connection Refused".
What the heck is going on?
 
 
 

TcpClient unable to connect to a TcpListener

Post by Arkady Fre » Thu, 22 Dec 2005 14:01:54

What's about ping and check that listener really listen on the port ypu try
to connect on client ( netstat -a )
Arkady

 
 
 

TcpClient unable to connect to a TcpListener

Post by VEJKX01pc3 » Thu, 22 Dec 2005 23:29:02

I have eliminated just about everything I can think of:
1) Unplugged from internet
2) Got a cable here from work so I don't need a hub - the two computers are
directly connected.
3) I turned off XP firewall on both boxes.
4) I hard set the IP address 192.168.0.1 and 192.168.0.2.
5) I ran a virus scann on both boxes
6) I can ping both boxes
7) netstat -a shows my listen port
nothing
The only way I can get this to work is if both apps are on the same box
and I use 'localhost' in the TcpClient construct
TcpClient tcpClient = new TcpClient("localhost",4444);
If I try using 192.168.0.1 it doesn't work (even on the same box)
 
 
 

TcpClient unable to connect to a TcpListener

Post by Arkady Fre » Fri, 23 Dec 2005 04:50:54

So what is write error if connect OK and peer host ( ip/port ) is really one
you specify on
on connect
Arkady
 
 
 

TcpClient unable to connect to a TcpListener

Post by VEJKX01pc3 » Fri, 23 Dec 2005 05:17:02

An invalid argument was supplied..."
My server app kicks out a message to the console as soon as it accepts a
connection
and I never see that even though the client app says it is connected. What
my client
app is connected to I have no idea but it is not my server app.
It is like some process is running on my box that is capturing all TCP/IP
connections.

"Arkady Frenkel" wrote:

 
 
 

TcpClient unable to connect to a TcpListener

Post by Arkady Fre » Fri, 23 Dec 2005 05:23:52


"TBJ_Misys" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
Check exception in depth

Just check that with netstat ( each local IP / port have peer one )
Arkady



 
 
 

TcpClient unable to connect to a TcpListener

Post by VEJKX01pc3 » Sat, 24 Dec 2005 23:39:02

Well, I finally figured it out. It was Cox Cable's Security software that was
causing the problem - CurtainsSysSvcNT.exe. First I stopped the security
software but nothing. Then I notice in task manager that CurtainsSysSvcNT.exe
was still running so I killed it - still nothing. Finally I de-installed the
Cox Security software and now everthing works. Question - how does
CurtainsSysSvcNT.exe work - how do you go about writing something like that?