Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / January 2007

Tip: Looking for answers? Try searching our database.

.NET and multithread networks server application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cube - 14 Dec 2006 22:10 GMT
Hi,

I have developed large multithreaded network application using Win32
and Winsock in the past connecting to an SQL db.

How fast and robost is .NET 2.0 for creating a similar application?

I need to create an client and server application. The client
application consists of C# Window.form controls which connects to a
database. But I need the client to connect to a server application, and
the server will control access to the database as well as report other
live information.

Is C# and .NET suitable for handling the server application? It needs
to scale to handle many many connections on multiple threads.

Also the Client C# application binds to a database, but now it needs to
connect to a server application and then to the database. Do I need to
create wrapper classes for my data and perform serialization ? or is
there some other approach in .NET?

Regards

John
Chris Mullins - 14 Dec 2006 22:45 GMT
Depending on your definition of "robust server applications" .NET 2.0 is a
pretty good platform for building such applications.

If I had to build true carrier class server applications, I'm not sure if I
would choose it - but then again, I don't think there are any mainstream
platforms suitable for that level of robust.

Using 64-bit hardware and a fair bit of blood/sweat/tears we've been able to
scale our .Net server application beyond any reasonable limits that we
expect to see. You will end up learning just as much about .Net internals as
you know about Win32 internals.

The architecture you describe sounds a bit strange, to be honest. If you're
building a server application, why are you also having clients connect
directly to the database? You're mixing application architectures, and it's
likley that little good will come of it.

Some things to think about regarding the server architecture:
http://www.coversant.net/dotnetnuke/Default.aspx?tabid=88&EntryID=10

... and, of course, one of the most critical pieces: Can you debug it once
it's up and running?
http://www.coversant.net/Default.aspx?tabid=88&EntryID=28

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins

> Hi,
>
[quoted text clipped - 20 lines]
>
> John
Cube - 20 Dec 2006 05:08 GMT
> The architecture you describe sounds a bit strange, to be honest. If you're
> building a server application, why are you also having clients connect
> directly to the database? You're mixing application architectures, and it's
> likley that little good will come of it.

Our past win32 software used serialised classes that we sent through a
socket before we deserialised and called a database. This is simply our
lack of understanding of .NET.
I thought there may be an automated way to use an intermediary class
that takes care of serialisation for .NET. Like a BindingRemoteable
type class. It would save time during development.

Take the following example.
A GUI Application must remotely access a database via a remote server.
Eg.
1. GUI APP-> Address record entry screen
Send request to Server App for Address record
2. Server App: Requests address from database
3. Server App: Send Serialized class to GUI APP
4. GUI APP-> Display Address

Our current understanding is that we can do 1 of the follow,
1. Create a TCP connection to our server and send a xml class to the
server - server decodes and retrieves data from database.
2, Use Remoting...although we are unsure as to how the security will
work with that.

We will then be programably populating our windows form controls,

> Some things to think about regarding the server architecture:
> http://www.coversant.net/dotnetnuke/Default.aspx?tabid=88&EntryID=10

Excellent way to overcome incoming data problems.
I used an almost identical architecure in a win32 large project 5 years
ago.
David Browne - 15 Dec 2006 16:37 GMT
> Hi,
>
[quoted text clipped - 16 lines]
> create wrapper classes for my data and perform serialization ? or is
> there some other approach in .NET?

You want to build a client/server application. Yes C# and .NET are very well
suited to that.

This is a very straightforward and common type of application to build in
.NET.  Typically you don't code directly against TCP/IP sockets, rather use
one of a few frameworks that work at a higher level and handle the plumbing
for you.

The best and most robust of these is the new Windows Communication
Foundation (WCF) in .NET 3.0.

Windows Communication Foundation
http://msdn2.microsoft.com/en-us/library/ms735119.aspx

Other good options are Web Services
http://msdn.microsoft.com/webservices/default.aspx

and .NET Remoting.
http://msdn.microsoft.com/webservices/remoting/default.aspx

All of these are substantially simpler than coding TCP/IP and provide simple
mechanisms to call methods and marshal objects across networks.  Of course
.NET also has easy access to TCP/IP sockets so if you really want to write
code at that level, you can.

David
Cube - 20 Dec 2006 05:11 GMT
> The best and most robust of these is the new Windows Communication
> Foundation (WCF) in .NET 3.0.
>
> Windows Communication Foundation
> http://msdn2.microsoft.com/en-us/library/ms735119.aspx

isnt that vista only?

> Other good options are Web Services
> http://msdn.microsoft.com/webservices/default.aspx
>
> and .NET Remoting.
> http://msdn.microsoft.com/webservices/remoting/default.aspx

Remoting may be interesting we have just had a play with it, security
looks like an issue.

> All of these are substantially simpler than coding TCP/IP and provide simple
> mechanisms to call methods and marshal objects across networks.  Of course
> .NET also has easy access to TCP/IP sockets so if you really want to write
> code at that level, you can.

We may just do that, it what we did in win32, however if Remoting will
handle alot of the plumbing we need we will use it.
David Browne - 20 Dec 2006 05:22 GMT
>> The best and most robust of these is the new Windows Communication
>> Foundation (WCF) in .NET 3.0.
[quoted text clipped - 3 lines]
>
> isnt that vista only?

Windows XP SP2, Windows Server 2003 and Vista.  The .NET 3.0 Runtime ships
on vista, and is available as a free download for XP SP2 and Server 2003.

>> Other good options are Web Services
>> http://msdn.microsoft.com/webservices/default.aspx
[quoted text clipped - 4 lines]
> Remoting may be interesting we have just had a play with it, security
> looks like an issue.

Why?

>> All of these are substantially simpler than coding TCP/IP and provide
>> simple
[quoted text clipped - 6 lines]
> We may just do that, it what we did in win32, however if Remoting will
> handle alot of the plumbing we need we will use it.

Remoting  is much easier and basically as fast as raw sockets.  But using
Binary Serialization together with TCP/IP sockets in .NET is not really
difficult.  It's just that Web Services, Remoting and WCF are all easier and
more interoperable.

David
Cube - 20 Dec 2006 06:09 GMT
> >> The best and most robust of these is the new Windows Communication
> >> Foundation (WCF) in .NET 3.0.
> >>
> >> Windows Communication Foundation
> >> http://msdn2.microsoft.com/en-us/library/ms735119.aspx

> > isnt that vista only?
>
> Windows XP SP2, Windows Server 2003 and Vista.  The .NET 3.0 Runtime ships
> on vista, and is available as a free download for XP SP2 and Server 2003.

No Win2k support?

> > Remoting may be interesting we have just had a play with it, security
> > looks like an issue.
>
> Why?

our current system uses our own authentication system, a database table
for storing user/pass info for connecting clients, is this still
possible with .Remoting?

Does Remoting support a database table for storing user/pass info? hash
pass?
Algortithm choices?

> Remoting  is much easier and basically as fast as raw sockets.  But using
> Binary Serialization together with TCP/IP sockets in .NET is not really
> difficult.  It's just that Web Services, Remoting and WCF are all easier and
> more interoperable.

Great, but you have ruled out windows 2000 users with .NET 3
Might be able to live with that.
Will have a look at WCF.

Isnt .net3 still in beta? where is the sdk for it?
David Browne - 20 Dec 2006 19:13 GMT
>> >> The best and most robust of these is the new Windows Communication
>> >> Foundation (WCF) in .NET 3.0.
[quoted text clipped - 32 lines]
> Might be able to live with that.
> Will have a look at WCF.

WCF has a very extensible model for security, so you should be able to
plug-in your own stuff without owning 100% of the communication plumbing.

> Isnt .net3 still in beta? where is the sdk for it?

No it's released.

Microsoft .NET Framework 3.0 Redistributable Package
http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5
-25634C3BF043&displaylang=en


Microsoft® Windows® Software Development Kit for Windows VistaT and .NET
Framework 3.0 Runtime Components
http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-4DFB-AA0C
-DB53035F40A0&displaylang=en


David


Cube - 21 Dec 2006 04:17 GMT
> Microsoft® Windows® Software Development Kit for Windows VistaT and .NET
> Framework 3.0 Runtime Components
> >http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-4DFB-AA0C
-DB53035F40A0&displaylang=en

Will the SDK work on XP?
David Browne - 21 Dec 2006 04:49 GMT
System requirements are on the download page.

http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-4DFB-AA0C
-DB53035F40A0&displaylang=en#Requirements


> Microsoft® Windows® Software Development Kit for Windows VistaT and .NET
> Framework 3.0 Runtime Components
> >http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-4DFB-AA0C
-DB53035F40A0&displaylang=en

Will the SDK work on XP?
Ciaran O''''Donnell - 02 Jan 2007 10:15 GMT
Remoting isnt as fast as real raw sockets but you do get a lot with it.
Remoting isnt just about sending an object down a wire but about getting
remote object references so you can grab a reference to an object that is
running on another machine and you can call methods on it will run on the
remote machine and return the results to the client.

The fastest way to communicate I believe is to setup a tcpclient and
tcplistner to get a socket to socket connection. Then spit bytes down the
wire by serializing things writing raw bytes.

Also, WCF with binary serialization is faster than remoting as the protocal
has been streamlined.

Signature

Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com

> >> The best and most robust of these is the new Windows Communication
> >> Foundation (WCF) in .NET 3.0.
[quoted text clipped - 35 lines]
>
> David

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.