473,320 Members | 2,164 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,320 software developers and data experts.

Multiple connections in Managed C++ with TcpListener

Hi,
I have a server application which will allow
interfacing to a database and support multiple clients
over a telnet connection. Right now I have an infinite
loop that will accept a single client connection and
continue to listen for more (over writing the first).
For obvious reasons, the application can not do anything
else while it is in this loop. Added to this is the fact
that the application runs at 99% CPU resources. What
would be a better way to do this? Create a thread to run
the listener while the rest of the application deals with
client input? Or is there a DoEvents function in Managed
C++ that I could make use of?

Thanks,
Rob
Nov 16 '05 #1
2 3775
Use async Socket with BeginAccept/Begin* etc. It will use ThreadPool
automatically.

"Rob Tand" <an*******@discussions.microsoft.com> wrote in message
news:0a****************************@phx.gbl...
Hi,
I have a server application which will allow
interfacing to a database and support multiple clients
over a telnet connection. Right now I have an infinite
loop that will accept a single client connection and
continue to listen for more (over writing the first).
For obvious reasons, the application can not do anything
else while it is in this loop. Added to this is the fact
that the application runs at 99% CPU resources. What
would be a better way to do this? Create a thread to run
the listener while the rest of the application deals with
client input? Or is there a DoEvents function in Managed
C++ that I could make use of?

Thanks,
Rob

Nov 16 '05 #2
Thank you, I was able to get multiple clients to connect
with the async Socket.

-Rob
-----Original Message-----
Use async Socket with BeginAccept/Begin* etc. It will use ThreadPoolautomatically.

"Rob Tand" <an*******@discussions.microsoft.com> wrote in messagenews:0a****************************@phx.gbl...
Hi,
I have a server application which will allow
interfacing to a database and support multiple clients
over a telnet connection. Right now I have an infinite
loop that will accept a single client connection and
continue to listen for more (over writing the first).
For obvious reasons, the application can not do anything
else while it is in this loop. Added to this is the fact that the application runs at 99% CPU resources. What
would be a better way to do this? Create a thread to run the listener while the rest of the application deals with client input? Or is there a DoEvents function in Managed C++ that I could make use of?

Thanks,
Rob

.

Nov 16 '05 #3

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

Similar topics

2
by: Paul A. Steckler | last post by:
I need to write a TCP/IP server in C# that can handle multiple connections. My first try was to use TCPListener instances in multiple .NET threads. Of course, I got an exception from...
3
by: Adam | last post by:
My telnet server app. creates a new thread for each incoming Tcp client as shown in the code below. How can the client threads send text messages back and forth to each other? I don't understand...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
2
by: jasonsgeiger | last post by:
From: "Factor" <jasonsgeiger@gmail.com> Newsgroups: microsoft.public.in.csharp Subject: Multiple Clients, One port Date: Wed, 19 Apr 2006 09:36:02 -0700 I'm been working with sockets for a...
1
by: Thomas René Sidor | last post by:
Hello Having been trying to find the root of this problem for several days I now hope that you can help me. I'm implementing a distributed file system - consisting of, at the moment, a...
4
by: sracherla | last post by:
I am trying to write a simple windows service that accepts an incoming request; receives a string input and sends a string output. I need this connection to stay alive until the client closes it....
3
by: Wayne And Miles | last post by:
I have created a server application that listens for connections using the TCPListener class. When I connect to the server using a client on the same machine as the server, all works as expected. ...
15
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello everyone, I have this code for TCPListenPort. The code works fine, but my manager is asking me to establish multiple connections to the same port. How can i acheive that below is my...
4
by: Veeraraghavan | last post by:
Hi All, I am developing a client server communication using system.net.socket and I am finding it very difficult to get a solution for this. I started with single port communication with single...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.