Re: Eunet or EuLibnet or TCP socket library (or socket.e)
- Posted by Spock Jun 03, 2016
- 2212 views
I have to write a custom invoice maker for our company. (They realized that the client-facing Excel or Word documents later handed to Finance to key into the accounting system were not a good idea). Anyway, I want to utilise a multi-client server system.
With the data sizes you're talking about, a synchronous server shouldn't cause any perceivable delays. You can read/write megabytes of data on the database in a fraction of a second...
I added message framing and a receive loop to the experimental code. The basic socket code always could send an arbitrary length data. My receive function can now receive arbitrary lengths - Yippee ! You are right about the speed. I tested the throughput (2-way) up to 2,000,000 bytes and it takes only 1/6 second running the server and client on a single computer. Over an actual network the speed will drop but my modest app would be happy with even 5% of that rate.
You could accomplish a pseudo-asynchronous server by combining the select function with Multi-tasking ..
I have been reading about Finite State Machines. They seem well suited for solving the problem of parallel but independent actions. Once the single instance server core is stable I'll add an FSM to allow multiple connections in parallel. Muhahaha...
Spock