473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Issue with TCPClient

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.Def ault,true);
writer=new StreamWriter(clientSocket.GetStream());
writer.AutoFlush=true;

WaitForResponse(ref reader,WaitForResponseInterval);

string strResponse=reader.ReadLine();
Jul 29 '08 #1
2 1798
On Jul 29, 11:55*am, Chris <nospample...@nospam.comwrote:
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.Def ault,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
Jul 29 '08 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
On Jul 29, 11:55 am, Chris <nospample...@nospam.comwrote:
>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.Def ault,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

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

Chris
Jul 29 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Daniel | last post by:
TcpClient close() method socket leak when i use TcpClient to open a connection, send data and close the TcpClient with myTcpClientInstance.Close(); it takes 60 seconds for the actual socket on...
2
by: Theo | last post by:
Hi, I am using a tcpclient and a tcplistener to send and receive packets. The client sends a packet and the listener replies with another one. I can send 2 packets and get an answer from the...
3
by: מורדי | last post by:
Hi, I'm writing a client/server application in which the client send a series of screenshots to the server to be saved using the tcpclient. in most cases the first screenshot is transmitted ok...
1
by: Jimbo | last post by:
Hi People, I have the following bit of code: Console.WriteLine(DateTime.Now.ToString()); TcpClient tcp = new TcpClient(server, port); Console.WriteLine(DateTime.Now.ToString()); When...
3
by: Ricardo Quintanilla | last post by:
i had a problem whom i do not know how to explain. i was using a TcpClient (System.Net.Sockets.TcpClient) object to send and receive data to an AS400 socket. Two months ago it started to work...
3
by: Danny Tuppeny | last post by:
Hi all, I'm trying to send a null character as a string delimiter through a TcpClient (code below). It's to connect to this poker bot room: http://games.cs.ualberta.ca/webgames/poker/bots.html...
0
by: Torsten Brasch | last post by:
Hi All and Happy New Year ;) I have a very strange problem with System.Net.Sockets.TcpClient(). For some reason, the number of bytes I can receive is limited to 5460 bytes. I made sure that the...
1
by: hamil | last post by:
I am having trouble using the TcpListener and TcpClient classes. At the end of this post is server code that runs, and a class whose purpose is described below. I need to know when the client...
5
by: puzzlecracker | last post by:
It looks like i need to get IPEndPoint first, but I cannot figure out from msdn the eventual obtainment of machine name and port number. Please suggest a solution. Thanks
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.