472,353 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 11769
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.