![]() |
| | #1 |
| Super Moderator Join Date: Sep 2001
Posts: 4,746
| Multiple Object Declarations The server sets up a socket that acts as a listener. Every time that socket recieves a request it starts a new thread to process that request. Basically I have a while loop that will cycle until the user tells the server to stop accepting requests. In that loop, a thread is declared, which means I'm going to have multiple declarations. This was on example source code from a seemingly reliable source, so I ignored it before now. Can anyone think of a way around this if this is indeed a problem? Code: while (Status = true)
{
Thread ClientThread = (new ThreadStart(Client.Http());
ClientThread.Start();
} edit: The above source code has been oversimplified to illustrate only the problem at hand. The threads are only created after a request has been recieved. |
| sean is offline | |
| | #2 |
| Registered User Join Date: Aug 2002
Posts: 1,330
| The GC will take care of it. |
| BMJ is offline | |
| | #3 |
| Super Moderator Join Date: Sep 2001
Posts: 4,746
| Nice... I love this language... Does the same apply for Sockets? Each thread has a socket paired with it... |
| sean is offline | |
| | #4 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,770
| The same applies to any object in C#
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| circular doubly linked list help | gunnerz | C++ Programming | 5 | 04-28-2007 08:38 PM |
| Animating Multiple Object - [Open Gl] | Tonto | Game Programming | 6 | 09-29-2006 06:31 PM |
| Linked List Templates and Object Types | ventolin | C++ Programming | 10 | 06-16-2004 12:05 PM |
| Using multiple source files: Multiple Declarations & Wrong line numbers | Inquirer | C++ Programming | 1 | 05-01-2003 02:52 PM |
| multiple object instances at runtime | mrukok | C++ Programming | 1 | 03-25-2003 07:26 AM |