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

Server app can't handle 230+ clients

Hi all,

I am testing how well my server application is connecting to multiple
clients and give and take some information. All actions(connect, accept,
send, receive) are performed by async methods - BeginXXX() and callbacks - in
both server and client sides.

As I increase the number of client connections more than 230, I am getting
socket exception: 10054(An existing connection was forcibly closed by the
remote host) in server application. What was happening was, for that
unsuccessful connections, connections seems to be established well then it's
calling BeginRead() where the exception is being thrown..

Any ideas? How can I decide if it's a performance issue?

Bob

<server side>

ClientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
ClientSocket.SetSocketOption(SocketOptionLevel.Soc ket,
SocketOptionName.ReuseAddress, true);
ClientSocket.Bind(endpoint);
ClientSocket.BeginConnect(ClientIPAddress,
Properties.Settings.Default.ListenPort,
new AsyncCallback(ConnectCallback), myState);

<client side>

// StartListen() function

listener = new TcpListener(IPAddress.Parse(IP), port);
listener.Start(3000);
listener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback),
listener);

// DoAcceptSocketCallback() function

TcpListener listener = (TcpListener)ar.AsyncState;
Socket soc = listener.EndAcceptSocket(ar);
listener.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback),
listener);
soc.BeginReceive(rxBuf, rxOffset, rxBuf.Length - rxOffset, SocketFlags.None,
new AsyncCallback(ReadCallback), conn);

Sep 24 '07 #1
2 2366
bbg wrote:
I am testing how well my server application is connecting to multiple
clients and give and take some information. All actions(connect, accept,
send, receive) are performed by async methods - BeginXXX() and callbacks - in
both server and client sides.

As I increase the number of client connections more than 230, I am getting
socket exception: 10054(An existing connection was forcibly closed by the
remote host) in server application. What was happening was, for that
unsuccessful connections, connections seems to be established well then it's
calling BeginRead() where the exception is being thrown..

Any ideas? How can I decide if it's a performance issue?
Try check some of the registry settings in:

http://smallvoid.com/article/winnt-tcpip-max-limit.html

It is just a wild guess, but ...

Arne
Sep 25 '07 #2
Arne, thanks much for this helpful pointer!
Bob

"Arne Vajhøj" wrote:
bbg wrote:
I am testing how well my server application is connecting to multiple
clients and give and take some information. All actions(connect, accept,
send, receive) are performed by async methods - BeginXXX() and callbacks - in
both server and client sides.

As I increase the number of client connections more than 230, I am getting
socket exception: 10054(An existing connection was forcibly closed by the
remote host) in server application. What was happening was, for that
unsuccessful connections, connections seems to be established well then it's
calling BeginRead() where the exception is being thrown..

Any ideas? How can I decide if it's a performance issue?

Try check some of the registry settings in:

http://smallvoid.com/article/winnt-tcpip-max-limit.html

It is just a wild guess, but ...

Arne
Sep 25 '07 #3

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

Similar topics

7
by: rdh | last post by:
Hi all, I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the...
16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
0
by: Michael Goettsche | last post by:
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game . I know this game could be written without a server, but the...
5
by: Parahat Melayev | last post by:
I am trying to writa a multi-client & multi-threaded TCP server. There is a thread pool. Each thread in the pool will handle requests of multiple clients. But here I have a problem. I find a...
4
by: SRLoka | last post by:
After reading the newsgroups and various .Net web sites, I have come to a conclusion that BeginReceive and BeginSend are the way to go as they use IOCompletion Ports(I have no clue what they mean...
4
by: Macca | last post by:
I am writing an application that uses asynchronous sockets to get data over ethernet from embedded devices, up to 30 concurrent devices.(These devices are written in C). My application...
8
by: swell | last post by:
I would like to write a server with the low level API of python ( socket+select and/or socket+thread ) that allow me to register client and update them every X seconds ( could be the time, the...
14
by: Guillermo_Lopez | last post by:
Hello, Our company has developed several Access applications for our clients and we wish to expand to use a database server. We wish to use Access as the front end application and SQL Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.