473,397 Members | 2,099 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,397 software developers and data experts.

TCP Client error on stream

Hello
I am in the process of making a small app that will be used by the slightly
more, er, IT challenged customers we have to send us their databases via
FTP.
Going ok, but when I come to writing the data stream it is terminating with
"unable to write data to the transport connection tcpclient"

Adding a quick messagebox on the exception, I am getting:
"An established connection was aborted by the software in your host
machine".

code sample:

'Begin upload of data
Dim TheStream As Stream = Conn.GetStream
Dim StreamStatus As Boolean = TheStream.CanWrite
BytesRead = FStream.Read(bData, 0, 1024)
TheStream.Write(bData, 0, 1024)
TotalBytes = 1024
While BytesRead > 0
Try
BytesRead = FStream.Read(bData, 0, 1024)
TheStream.Write(bData, 0, BytesRead)
TotalBytes = TotalBytes + 1024
RaiseEvent SendProgress(TotalBytes)
Catch ex As Exception
MsgBox("Error sending data:" & vbCrLf & vbCrLf &
ex.GetBaseException.Message & vbCrLf & vbCrLf & "Stack Trace:" &
vbCrLf & ex.GetBaseException.StackTrace, MsgBoxStyle.Exclamation, "Error
sending data")
Exit While
End Try
End While
It is failing on the looping bit of sending- the first send passes ok. If I
connect in to the FTP server manually via the windows command line ftp
client, I can see my destination file with a size of 0 bytes.

I am using pasv mode as I am behind a NAT Router and the active mode meant
that I would be sending the PORT command with my local IP address
(192.168.x.x).

We also have an odd dual router setup here - a nat router with 2 adsl modems
running off it in load balancing. Although I am forcing all port 21 traffic
down one channel, the second connection for the data stream often goes down
the other meaning it the data part doesn't even connect. I dont mind that as
the customers won't have anything similar, but I wonder if it is part of the
problem I am having? I guess once the connection is established my sending
of data to the stream won't swap channel willy-nilly?

James.
Dec 12 '05 #1
1 1553

"JamesB" <ja***@spamiscrappy.puffle.co.spam.uk> wrote in message
news:43***********************@news.zen.co.uk...
Hello
I am in the process of making a small app that will be used by the
slightly more, er, IT challenged customers we have to send us their
databases via FTP.
Going ok, but when I come to writing the data stream it is terminating
with "unable to write data to the transport connection tcpclient"


<snip>

Fixed my own problem - our ftp space was full. <slaps forehead>
Dec 13 '05 #2

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...
1
by: Paul Fi | last post by:
I have this client code: string server = "localhost"; int port = 8085; IPHostEntry hostent = Dns.Resolve(server); IPAddress hostadd = hostent.AddressList; IPEndPoint EPhost = new...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
6
by: john deviney | last post by:
I have a C#/.Net 1.1 client talking to a Java based web service. I need to insert a soap header on the client side which is expected on the server side. Currently, the Java ws provider, Axis, does...
8
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service...
13
by: Sandeep Singh | last post by:
I am making socket client application in C# how can i get ip address of client who has connected to server
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
5
by: Yossarian | last post by:
I have a handheld running CE .NET 4.2 and I am using c# with framework 1.1 to develop a solution for syncing data that is on the handheld with the local pc. Our handheld cradles only support...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.