arh! my brain is too stupid... I keep thinking of how to find a best way to handle sockets with multithreads or event in app like ftp server.

can someone help me out please???

I think its best for me to learn is by pseudo code or maybe source:rolleyes:

I really really need to find out how those ftp or http server able to handle 2000+ connections

I have posted a thread about multithread sockets, but seems no reply,,

I really need this help to get going with my winsock programming..

Please!

I really thank you for your kind of help:alright:
Posted on 2002-03-07 19:04:55 by Yanda
If you need a server that can handle that amount of requests, you may need to use overlapped I/O. I haven't done anything with it as I never had such requirements, and it's not easy to use. But it gives you the best performance.
The second fastest method is using events, there have been several threads about this.
A very interesting winsock FAQ can be read here: http://tangentsoft.net/wskfaq/
I recommend you to read it and then think about a good design for your server.
There aren't many asm examples but I think you can find C examples, try google.

Thomas
Posted on 2002-03-08 12:19:04 by Thomas
?? I am absolutely new on network programming. But where should be the problem with 2000+ connections?

You get 2000+ requests and answer them in a given order. What problem?

Don't misunderstand me. I want to learn about networking and I really can't see any problem there.(But I've not the skill to open a connection:grin: )

So please help my sillyness and explayn the problems there.
Posted on 2002-03-08 14:11:18 by TCT

?? I am absolutely new on network programming. But where should be the problem with 2000+ connections?

You get 2000+ requests and answer them in a given order. What problem?


The problem is not the design of your program. You could easily have a design to support 1 million connections. The problem is the method of handling incomming and outgoing data.
You certainly *not* want to use window messages (WSAAsyncSelect) to handle 2000 connections... It's highly inefficient. Events are quite fast and can handle many connections, but overlapped I/O is even better (and harder to program).

Thomas
Posted on 2002-03-08 14:16:00 by Thomas
Ah.

So I can skip the chapter about events. :grin:

Ok, that seems clear.
.
.
But is overlapped I/O part of Winstock?
Posted on 2002-03-08 16:51:29 by TCT
Thankx alots for the replies,

Thomas, the "events" you are talking about is a event created with WSACreateEvent rite? or something else???

I keep hearing "event driven server", "multithreaded server", and "IO completion port server"...

some people said "event driven server" is faster and others don't..

ok, which is the best one that suite a minimal of 500 connections ftp server???


sincerely,
Posted on 2002-03-08 17:06:58 by Yanda
TCT: But is overlapped I/O part of Winstock?


It's also used in file I/O in windows, but winsock related overlapped I/O is available in winsock2+, which is available to most people (only win95 and NT3 (?) havewinsock1.x).

Thomas, the "events" you are talking about is a event created with WSACreateEvent rite? or something else???


That's the one, but I think WSACreateEvent is just a wrapper for the general API CreateEvent.

I keep hearing "event driven server", "multithreaded server", and "IO completion port server"...

some people said "event driven server" is faster and others don't..

ok, which is the best one that suite a minimal of 500 connections ftp server


The fastest is overlapped I/O, but events are much easier to program. I think that events will do for 500 connections. It also depends on the OS you are using. win9x has a limitation (100 iirc) of the number of connections you can use simultaniously. So you should use some NT version to be able to use 500 connections anyway...
At my site you can download the winsock2 helpfile, if you have a fast connection download the latest platform SDK, all the I/O methods are described their as well.. The winsock FAQ I mentioned also shows the different ways to implement I/O...
If you really need the speed, go for overlapped I/O, but keep in mind that it's not easy.
If you want a reasonable speed, use events. In any case, never use windows messages or blocking sockets, those are the worst performers.

Thomas
Posted on 2002-03-08 17:35:10 by Thomas
ok, thankx Thomas!

I will do my best to understand them :rolleyes:


sincerely,
Posted on 2002-03-08 19:39:45 by Yanda