473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CanWr ite
BytesRead = FStream.Read(bD ata, 0, 1024)
TheStream.Write (bData, 0, 1024)
TotalBytes = 1024
While BytesRead > 0
Try
BytesRead = FStream.Read(bD ata, 0, 1024)
TheStream.Write (bData, 0, BytesRead)
TotalBytes = TotalBytes + 1024
RaiseEvent SendProgress(To talBytes)
Catch ex As Exception
MsgBox("Error sending data:" & vbCrLf & vbCrLf &
ex.GetBaseExcep tion.Message & vbCrLf & vbCrLf & "Stack Trace:" &
vbCrLf & ex.GetBaseExcep tion.StackTrace , MsgBoxStyle.Exc lamation, "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 1577

"JamesB" <ja***@spamiscr appy.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
4438
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 strings' instead of 'one liners' I check the streams for terminators. I'm having problems with the connection, I've been looking and debugging for 2 weeks now (debugging with an emulator is terribly slow..) but I'm not getting it...
1
3005
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 IPEndPoint(hostadd, port); Socket soc = new Socke(AddressFamily.InterNetwork, SocketType.Stream,ProtocolType.Tcp);
5
3068
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 explorer would do in this case. The headers I am getting are: Headers {Content-Disposition: attachment; filename="dynamic_file.mdb" Connection: close Cache-Control: private Content-Type: application/octet-stream
4
6738
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
20291
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 not support automatic wsdl generation of custom headers so the wsdl has no information regarding the required header. I've read through a lot of material and managed to get a workable solution but it is far from ideal. I created a new...
8
2747
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 starts objects for all these 25 clients are created and when client connects it should be accepted and will not allow more than 25 clients to connect and when client diconnects that object can be allocated to another client who requests i am not...
13
28780
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
4452
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
3445
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 network connections, no usb or serial, so i have to use networking to get the data transfered. Here's the problem. I have the server accepting connections fine, but i'm a little confused how to actually send the server data, and then how the...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10113
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.