Re: [twsocket] Multiple port listening server

2008-07-16 Thread Stratus
Thank you very much to all !
As a first try, I will go to the mono thread. Using the same


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-16 Thread Stratus
Sorry - I pressed the wrong key :-)

Thank you very much to all !
As a first try, I will go to the mono-thread route. Using the same event 
handlers is a huge improvement to my initial idea.
Angus : I will take a look at your program, that may help a lot. Thank you.
Arno : I will do some extensive tests to sort out if multithreading is 
useful in that case or not..



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Francois PIETTE
 I'm trying to write a server program to listen to approx 50 ports
 simultaneously.
 Is there a more elegant way than spawning one TSocketServer per port ?

Basically, this is the way to go. Don't worry too much about 50 components 
because the code is shared by all components. Onlythe data part is allocated 
for each. And you can use the same event handlers for all of your 50 
components, provided you correctly make use of the sender argument in each 
event handler. Sender always refer to the component triggering the event.

--
[EMAIL PROTECTED]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Stratus
Thank you for your answer François.

Ok. Another question rises : As I have to save to disk every stream received, 
should I process it on a different 'save to disk' thread, or the internal 
TSocket buffers can cope the wait?

Thank you. 


Basically, this is the way to go. Don't worry too much about 50 components 
because the code is shared by all components. Only the data part is allocated 
for each. And you can use the same event handlers for all of your 50 
components, provided you correctly make use of the sender argument in each 
event handler. Sender always refer to the component triggering the event.




-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Arno Garrels
Stratus wrote:
 Thank you for your answer François.
 
 Ok. Another question rises : As I have to save to disk every stream
 received, should I process it on a different 'save to disk' thread,
 or the internal TSocket buffers can cope the wait? 

I'm pretty sure that you do not need multiple threads for this purpose.
Asynchron winsock API makes it possible. 

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

 
 
 Thank you.
 
 
 Basically, this is the way to go. Don't worry too much about 50
 components because the code is shared by all components. Only the
 data part is allocated for each. And you can use the same event
 handlers for all of your 50 components, provided you correctly make
 use of the sender argument in each event handler. Sender always
 refer to the component triggering the event. 
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Angus Robertson - Magenta Systems Ltd
 *Subject:* Re: [twsocket] Multiple port listening server
 *From:* Stratus [EMAIL PROTECTED]
 Ok. Another question rises : As I have to save to disk every stream 
 received, should I process it on a different 'save to disk' thread, 
 or the internal TSocket buffers can cope the wait?

I have an ICS application that does what you seem to be attempting, it
listens and save data to text files, I've tested it with 260 simultaneous
TCP connections writing 260 separate text files one line per second, all
at the same time, using a single thread.  I've never had a problem
writing files, but opening them can be a challenge particularly is
automated back-up is being used. 

http://www.magsys.co.uk/comcap/

The ComCap package also includes a utility ComGen that will generate up
to 500 simultaneous connections and send lines of data at varying speeds,
very useful for testing servers. 

Both applications use the IP Log Streaming Component in dynamic arrays to
listen and send data, it will save you a lot of time. 

http://www.magsys.co.uk/delphi/magics.asp

BTW, there is an experimental ICS Multi-Listen Socket Server, that will
listen on an unlimited number of IPs and/or ports, Arno will tell you
more.  


Angus
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Fastream Technologies
I need to add: if you want to use the advantage of multiple CPUs/cores,
single thread cannot do that.

On Tue, Jul 15, 2008 at 7:55 PM, Arno Garrels [EMAIL PROTECTED] wrote:

 Stratus wrote:
  Thank you for your answer François.
 
  Ok. Another question rises : As I have to save to disk every stream
  received, should I process it on a different 'save to disk' thread,
  or the internal TSocket buffers can cope the wait?

 I'm pretty sure that you do not need multiple threads for this purpose.
 Asynchron winsock API makes it possible.

 --
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html


 
  Thank you.
 
 
  Basically, this is the way to go. Don't worry too much about 50
  components because the code is shared by all components. Only the
  data part is allocated for each. And you can use the same event
  handlers for all of your 50 components, provided you correctly make
  use of the sender argument in each event handler. Sender always
  refer to the component triggering the event.
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Multiple port listening server

2008-07-15 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote:
 BTW, there is an experimental ICS Multi-Listen Socket Server, that
 will listen on an unlimited number of IPs and/or ports, Arno will
 tell you more.

I cannot, this project died.

--
Arno Garrels



  
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be