Issue with TCPClient

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have downloaded the OPENPop project from sourceforge and was playing
with how to process emails from a mailbox using pop3. It seems that I
get an error whenever running on a vista box but just fine on XP or
Win2k3. I upgraded the project to 2008 and 3.5 framework.

This the the area of code I am having issue with. I never get data from
the stream (reader.ReadLine()), it always returns null. I am pretty
sure this is a security issue. Like I said, it works on other OS.
Thanks in advance guys.

clientSocket=new TcpClient();
clientSocket.ReceiveTimeout=_receiveTimeOut;
clientSocket.SendTimeout=_sendTimeOut;
clientSocket.ReceiveBufferSize=_receiveBufferSize;
clientSocket.SendBufferSize=_sendBufferSize;

try
{
clientSocket.Connect(strHost,intPort);
}
catch(SocketException e)
{
Disconnect();
Utility.LogError("Connect():"+e.Message);
throw new PopServerNotFoundException();
}

reader=new StreamReader(clientSocket.GetStream(),Encoding.Default,true);
writer=new StreamWriter(clientSocket.GetStream());
writer.AutoFlush=true;

WaitForResponse(ref reader,WaitForResponseInterval);

string strResponse=reader.ReadLine();
 
I have downloaded the OPENPop project from sourceforge and was playing
with how to process emails from a mailbox using pop3.  It seems that I
get an error whenever running on a vista box but just fine on XP or
Win2k3.  I upgraded the project to 2008 and 3.5 framework.

This the the area of code I am having issue with.  I never get data from
the stream (reader.ReadLine()), it always returns null.  I am pretty
sure this is a security issue.  Like I said, it works on other OS.
Thanks in advance guys.

clientSocket=new TcpClient();
clientSocket.ReceiveTimeout=_receiveTimeOut;
clientSocket.SendTimeout=_sendTimeOut;
clientSocket.ReceiveBufferSize=_receiveBufferSize;
clientSocket.SendBufferSize=_sendBufferSize;

try
{
        clientSocket.Connect(strHost,intPort);                          }

catch(SocketException e)
{                              
        Disconnect();
        Utility.LogError("Connect():"+e.Message);
        throw new PopServerNotFoundException();

}

reader=new StreamReader(clientSocket.GetStream(),Encoding.Default,true);
writer=new StreamWriter(clientSocket.GetStream());
writer.AutoFlush=true;

WaitForResponse(ref reader,WaitForResponseInterval);

string strResponse=reader.ReadLine();

r u sure you do not have the firewall activated?
run the VS as administrator (right click, run as administrator) and
see what happens
 
Ignacio said:
r u sure you do not have the firewall activated?
run the VS as administrator (right click, run as administrator) and
see what happens


I am definitely not running a firewall and running as administrator had
no effect. We verified this happens on two different vista installs.

Chris
 
Back
Top