473,387 Members | 1,463 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,387 software developers and data experts.

Unable to read data from the transport connection

Hi to all,

Im searching a hand to solve an Exception that i get when i try to give the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop.gmail.com",995); //stablish a connection

Networkstream=Server.GetStream();//returns the first stream

Readerstream=new StreamReader(Server.GetStream());

username="xx*******@gmail.com";
string Data= "USER "+username + CRLF;
byte[] Data_ = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArr ay());
Networkstream.Write(Data_,0,Data_.Length);
string temp=read_single_line_response();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: Unable to read data from the transport connection.
---> System.Net.Sockets.SocketException: Se ha forzado la interrupciĆ³n de una
conexiĆ³n existente por el host remoto
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at GmailParser.Emailer.read_single_line_response() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 148
at GmailParser.Emailer.USER() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 101
at GmailParser.Emailer.Connect() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 50
at GmailParser.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Alpha1\Escritorio\GmailParsers\Form1.cs:l ine 78
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and%20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema
Dec 13 '05 #1
4 12081
you can check stream CanRead property before reading from it
why do you create StreamReader? you can read directly from network stream

Also notice that StreamReader is inherited from TextReader and NetworkStream
from Stream

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Josema" <Je******@ocu.org> wrote in message
news:4D**********************************@microsof t.com...
Hi to all,

Im searching a hand to solve an Exception that i get when i try to give
the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop.gmail.com",995); //stablish a connection

Networkstream=Server.GetStream();//returns the first stream

Readerstream=new StreamReader(Server.GetStream());

username="xx*******@gmail.com";
string Data= "USER "+username + CRLF;
byte[] Data_ =
System.Text.Encoding.ASCII.GetBytes(Data.ToCharArr ay());
Networkstream.Write(Data_,0,Data_.Length);
string temp=read_single_line_response();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: Unable to read data from the transport connection.
---> System.Net.Sockets.SocketException: Se ha forzado la interrupcion de
una
conexion existente por el host remoto
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at GmailParser.Emailer.read_single_line_response() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 148
at GmailParser.Emailer.USER() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 101
at GmailParser.Emailer.Connect() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 50
at GmailParser.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Alpha1\Escritorio\GmailParsers\Form1.cs:l ine 78
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and%20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema

Dec 13 '05 #2
port 995 for POP3 Gmail is using SSL. I hope thats not causing the
issue.

Dec 14 '05 #3
Thanks a lot Vadym, i will try first to use only Network Stream, and the Can
Read property...

--
Thanks
Regards.
Josema
"Vadym Stetsyak" wrote:
you can check stream CanRead property before reading from it
why do you create StreamReader? you can read directly from network stream

Also notice that StreamReader is inherited from TextReader and NetworkStream
from Stream

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Josema" <Je******@ocu.org> wrote in message
news:4D**********************************@microsof t.com...
Hi to all,

Im searching a hand to solve an Exception that i get when i try to give
the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop.gmail.com",995); //stablish a connection

Networkstream=Server.GetStream();//returns the first stream

Readerstream=new StreamReader(Server.GetStream());

username="xx*******@gmail.com";
string Data= "USER "+username + CRLF;
byte[] Data_ =
System.Text.Encoding.ASCII.GetBytes(Data.ToCharArr ay());
Networkstream.Write(Data_,0,Data_.Length);
string temp=read_single_line_response();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: Unable to read data from the transport connection.
---> System.Net.Sockets.SocketException: Se ha forzado la interrupcion de
una
conexion existente por el host remoto
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at GmailParser.Emailer.read_single_line_response() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 148
at GmailParser.Emailer.USER() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 101
at GmailParser.Emailer.Connect() in c:\documents and
settings\alpha1\escritorio\gmailparsers\emailer.cs :line 50
at GmailParser.Form1.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Alpha1\Escritorio\GmailParsers\Form1.cs:l ine 78
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and%20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema


Dec 14 '05 #4
Hi tdavisjr,

I only found in this url
(http://mail.google.com/support/bin/a...y?answer=13276) the port 995 for
the pop3....

Yes, as you say is for SSL, but what do you think about which port may i
use, to do that?? Do you know the number?

--
Thanks
Regards.
Josema
"tdavisjr" wrote:
port 995 for POP3 Gmail is using SSL. I hope thats not causing the
issue.

Dec 14 '05 #5

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

Similar topics

4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
0
by: Steve - DND | last post by:
We are continually receiving timeout, and "Unable to write data to the transport connection" errors while using the System.Net.HttpWebRequest class from an ASP.Net web page. Below are the two...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
0
by: Aryeh Holzer | last post by:
Hi, I've been trying to use the weather webservice available from the National Weather Service (NWS), at http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML. wsdl without success. Here's...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
1
by: Terrance | last post by:
I'm trying to create a small messenger program that uses the tcpclient and tcplistenter objects. When I start the application and run the thread that fires the tcplistener; once the client sends...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
7
by: Jay Balapa | last post by:
Hello, We have a Pocket PC client application which just connects to our webservice. When a client connects his Pocket PC through his WIFI he gets the following- Unable to read data from the...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.