简体   繁体   中英

Testing a C# sockets based multithreading server

We're developing a server application that uses sockets to handle client communication, obviously we want to test the server. Does anyone know of a good (open source) harness that can test the server using multiple threads on multiple client machines?

Quite frankly I would just roll your own and that's always what I do. A open source application would not be able to send packets according to your application level protocol as I'd advise to test at least authentication, some basic application level instructions, etc.

What I usually do is, write a stress tester application that spawns x amount (I usually test about 1000 clients per server) of clients and then just use a Timer (eg 25ms resolution) and on every timer callback, I randomly pick one of the connected clients and randomly execute either nothing, send data or disconnect the client. If I receive a disconnect notification for one of the clients, I spawn a new one to bring the total connected count back to x. Then I let the whole thing run for a couple hours...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM