Socket

N

Nico

Hi,
Sorry for my english, this isn't my native language andI'll try to be as
clear as possible.

I'm new to VB .NET and must create a server-type app (almost the same
app. I programmed in VB 6 using Winsock controls a few years ago but I start
this new app. from scratch and want to be "up to date"). I looked at the
..Net framework classes and discovered the System.Net.Sockets and its
sub-classes. I found that TCPListener class seems to be the most adapted as
it contains every functionnality I need.

But, there is a thing I dont understand (or I just didn't found the
right explanation): Every examples I found over the internet using this
class (or every other server-type class derived from System.Net.Sockets)
uses an endless loop (pooling) that verify the buffer of the socket to see
if it has recieved something from the client. Where is gone the "event
listener" that was present with the Winsock control ???? Just imagine I
have over 1500 to 8000 connections at the same time,each of them using a
thread with an endless loop, it's almost certain that I will overload my
CPU!!! This app is built to be used on a single CPU system, it is not
designed to be used with a system that have 40 CPU ;)

So, is there a way to set an event listener that will activate ONLY ON
DATA ARRIVAL, just like the Winsock control did and WITHOUT using an endless
loop to check if data was sent from the client ??? If yes, which class must
I use? And how do I implement it?

Thanks in advance !!

Nico
 
L

Locke Nash Cole

Nico,

The old mswinsck control you reference to did the same exactly thing, it
listened in a loop for when data is incoming. There's no way around that..
events are driven by checkers that check to see if an event has happend...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top