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

C# Network... Need Suggestions.

I want to transfer n number of binary files from a server
to a client one by one.

I am using TcpListener and TcpClient.

Any suggestions?

mE
Nov 15 '05 #1
1 1042
"mEEEEE" <an*******@discussions.microsoft.com> wrote in news:05f701c39ad3
$9****************@phx.gbl:
I want to transfer n number of binary files from a server
to a client one by one.

I am using TcpListener and TcpClient.

Any suggestions?

mE


TcpClient tc = tcpListener.AcceptTcpClient();
NetworkStream ns = tc.GetStream();

IAsyncResult iar = ns.BeginWrite(bytebuffer, offset, size, null, null);

//do some other processing

try
{
ns.EndWrite(IAsyncResult);
}
catch
{
//Networkerrors go here
}
other side:
TcpClient tc = new TcpClient();

tc.Connect(.......)

Networkstream ns = tc.GetStream();

IAsyncResult iar = ns.BeginRead(......)
//do some other processing

try
{
ns.EndRead(IAsyncResult);
}
catch
{
//Networkerrors go here
}
of course you could also use AsyncCallbacks so that you don't have
explicitely to wait for the end of the send/receive methods.

--
best regards

Peter Koen
-----------------------------------
MCAD, CAI/R, CAI/S, CASE/RS, CAT/RS
http://www.kema.at
Nov 15 '05 #2

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

Similar topics

6
by: Karl Roes | last post by:
Hi all, I am after some suggestions on ways to gracefully respond to situations where the network goes down while the database is in use. It doesn't happen that often, but when it does, the UI...
2
by: Ebrahim | last post by:
Does any one have any suggestion of Sending Files over a Network ? using TcpClient class in C#. I need suggestions on transferring huge files ( > 5MB) reliably over the stream . Also any kind of...
6
by: Christopher C | last post by:
I am currently working on an app the will be a shell replacement. Part of the goal is to list the current network status; basically I need to know if the network card is plugged in. I am currently...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
10
by: Woody Splawn | last post by:
I have been developing a ClientServer application on one machine at my office but the time has come to transfer it to the customer. The customer is running a Windows 2000 local area network. I...
1
by: diffuser78 | last post by:
I have to create a small and simple GUI app in Python which is similar to a netwrok game. Let me expalain you. I need some suggestions. I might use wxPython for GUI because that is the only GUI...
6
by: tendim | last post by:
G'day group. Currently our organization us using VB6 based applications, and I am trying to push forward and migrate some of the smaller things to VB.NET, eventually migrating all applications...
5
by: ordy62 | last post by:
I split a database to a FE and BE but the issue is the network shares. I have several groups that need to view this database but the network paths to database are different for example. ...
5
by: lmttag | last post by:
ASP.NET 2.0 (C#) application Intranet application (not on the Internet) Using Windows authentication and impersonation Windows Server 2003 (IIS6) Server is a member server on a domain Logged...
5
by: Phil | last post by:
A file used by my application may be stored on a shared network drive, so that it can be accessed by different people using the same application. I have written some code that uses an...
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...
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
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...

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.