develop a UDP to TCP relay server and UDP client to match
$250-750 USD
Płatność przy odbiorze
General: This project requires expertise in Visual Studio 2013, c++, c++11 and its programming style and libraries, asio as applies to udp, cereal serialization, and boost as needed, in the application of UDP communication. Please only apply if you are experienced with the methodologies listed.
Overview: a client application needs to make a request to a server and get a response. Currently this is done via a HTTP web service. In some cases the client environment breaks HTTP and TCP in general and we want to build a bypass that would communicate via UDP. A new relay server in the cloud talks UDP to the client, and relays the requests to an existing HTTP web service, gets the web service response, and relays it back through UDP to the client.
The scope of this project includes the client side udp communication and the full relay server.
The client side is a class, with a static but thread safe method that accepts a wstring request and returns a wstring response or generates an exception if something went wrong. This class would be compiled into the real product, but for development you must write some small wrapper to use it. Once a request is received, it is broken into chunks that would fit nicely into a UDP packet. The chunks are put into structures that include: A random 64 bit int designating this request, the chunk number, total number of chunks in this request, error status string "", and the chunk contents. The structures are serialized using cerial and sent over UDP to the server. The request and response can sometimes be 10s of megabytes.
The server collects the structures arriving over UDP. When all arrived, it reconstructs the original wstring request and sends it over HTTP POST to the existing web service. The service returns a wstring response or fails (timeout, 404, etc). The relay server send a response back to the client, using similar structures serialized by similarly. If there is an error a single UDP datagram is sent with the error indication filled. If no error, then the wstring is broken into chunks and sent back over UDP similarly to the way the client side sent it. The request number should match the one from the original client.
Timeout and cleaning: The client and server side will have a separate cleanup thread that runs in a loop once in a few minutes. The cleanup looks for requests that were never answered, or communications where chunks were missing for a long time. It will destroy the memory taken up by those stuck requests. When cleanup thread cleans request, the original request caller should get an error indication.
The relay server should use some existing library to call the HTTP POST and that library would have some timeout built in as well as error indications. The error indication would clean up the ongoing request and also be sent to the client as described above. One the client side we are building the communication from scratch, so a timer should watch over it and if it is not done within 60 seconds it should be aborted cleaned and an exception generated to the caller.
Platform: This project involves c++11 code on windows. Both on the client side and on the server side. However, we have plans to port both sides to Linux, so you may not use any Windows API or library and must code everything through pure c++11, boost and cerial, so that the code will be as portable as possible.
Numer ID Projektu: #9624722