473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

TcpClients and Threads

I am currently looking at writing a TCP client for talking to a number of
networked card readers. With Vb.Net, the process hangs pending an input. To
overcome this problem I am using the ThreadPool class and spawning a thread
for the TCPClient to wait for an input, which I then process.

However I want to design the software to cope with a large number of readers
(say 100). Is there any problem with me creating 100 threads and 100
TCPClients, all of which will sit there waiting for someone to swipe a card?
I haven't a feel for whether 100 threads is a lot or not.

- Jerry
Nov 21 '05 #1
1 968
On 2004-11-25, Jerry Spence1 <je**********@somewhere.com> wrote:
I am currently looking at writing a TCP client for talking to a number of
networked card readers. With Vb.Net, the process hangs pending an input. To
overcome this problem I am using the ThreadPool class and spawning a thread
for the TCPClient to wait for an input, which I then process.

However I want to design the software to cope with a large number of readers
(say 100). Is there any problem with me creating 100 threads and 100
TCPClients, all of which will sit there waiting for someone to swipe a card?
I haven't a feel for whether 100 threads is a lot or not.

- Jerry


Jerry...

To be honest, I would dump TCPClient and just use the socket class from
System.Net.Sockets. I would then use it's async methods to read and
write data. It's much more efficient this way.

here is a good place to start for .NET socket programming:
http://msdn.microsoft.com/library/de...consockets.asp

HTH
--
Tom Shelton [MVP]
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronan Viernes | last post by:
Hi, I have created a python script (see below) to count the maximum number of threads per process (by starting new threads continuously until it breaks). ###### #testThread.py import...
0
by: Al Tobey | last post by:
I was building perl 5.8.2 on RedHat Enterprise Linux 3.0 (AS) today and noticed that it included in it's ccflags "-DTHREADS_HAVE_PIDS." I am building with -Dusethreads. With newer Linux...
0
by: Mark | last post by:
Hi all, i am trying to create a small app which can record the requests from and responses to my browser. To achieve this i am using two tcpclients and a listener. The first 1 is listening to...
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
34
by: Kovan Akrei | last post by:
Hi, I would like to know how to reuse an object of a thread (if it is possible) in Csharp? I have the following program: using System; using System.Threading; using System.Collections; ...
10
by: [Yosi] | last post by:
I would like to know how threads behavior in .NET . When an application create 4 threads for example start all of them, the OS task manager will execute all 4 thread in deterministic order manes,...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
10
by: Darian | last post by:
Is there a way to find all the thread names that are running in a project? For example, if I have 5 threads T1, T2, T3, T4, T5...and T2, T4, and T5 are running...I want to be able to know that...
6
by: Shak | last post by:
Hi all, Three questions really: 1) The async call to the networkstream's endread() (or even endxxx() in general) blocks. Async calls are made on the threadpool - aren't we advised not to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.