Go to Post I have no defined complaints, and I have no solution. I simply have mixed feelings. - Andrew Blair [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #16   Spotlight this post!  
Unread 02-10-2014, 22:35
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: The DevServer TCP-based data server

Yesterday, I finished my new web interface, and consequently, the majority of the server project. I completely rewrote the web interface because the older one had a bit of a low performance and just didn't always work. I rewrote the entire server because there were a couple features I wanted to add that completely changed how to server booted and ran. Also, I was having some mutex problems that I fixed by changing the request handler. I also switched to using C++11 only features like std::timed_mutex, std::mutex, std::thread and std::unordered_map.

My program is written completely STL C++ (but not ANSI), so you should be able to compile code on any gcc compiler with a version of above 4.6 (C++0x+ support).

I have written an install script which just compiles the program and puts the build and required files in a location so the program should work right out of the box. The install script actually compiles the server so it should work for any platform.

The current installer should work in only Linux. I am going to soon start a Windows port, creating a Visual Studio 2013 Solution.

Changes:
-New GitHub repo so there is no mess with my having a hundred small programs in one repo
-User Program Capability (Must be enabled (enabled by default, with a sample program)). Put your code in userprgm.hxx.
-New web interface
--Poliished design, much easier to add features. The last version was me throwing together a bunch of stuff to create something that works
--More standardised JS (No longer 10 AJAX functions. Now only two generic ones (GET and POST)!)
--JavaScript, CSS and different modules in different files, put together by the browser via HTML, JS and AJAX calls
--You can now disable heartbeat, which sends responses every four seconds
--Heartbeat now sent to 4 seconds, not 1. Less network usage, but still works
--Standardised messagebox
-More AJAX
--Push form monitor integration now loaded via AJAX, so modding the push file means changing code in only one place
-CSS file in one place makes it much simpler to color interface to team standards
-Addding more web modules is now much easier. Just add another div in the top_menu, with a class of "top_menu_item", and with an onclick handler to load the module into content-content, and changing the title of content-title-content. Add the file to the server (I'll give a tutorial on request) and recompile to get access.
-You can now change servers on the fly without loading a different web interface. Open the menu and change the textbox to the new server location. The load server is what is loaded on launch


View repo at https://github.com/yash101/devserver. Note that the code for the installer is pulled from repo/linux/CMAKE/.

If you want to try out the server without doing much work, run the following command. the apt-get will only work on debian-based systems. If using something else, remove the apt-get install command and ensure you have git, cmake and build-essential (GCC, etc.) installed.

Code:
wget https://raw.githubusercontent.com/yash101/DevServer/master/devserver_installer.sh && chmod +x devserver_installer.sh && ./devserver_installer.sh
You can change server settings in config.hxx. Just make sure to recompile as they actually disable code compilation!

As usual, Good Luck!

REMEMBER: The server comes in demo mode. To fix, delete the build folder, enter the source folder and edit config.hxx. Enable/Disable anything you think is pointless.

I suggest that you disable:
-DEBUG_RNG
-DEBUG_WEBINF
-DETAILED_DEBUG
-ENABLE_CONSOLE

If you do not want to use the userprgm, get it out of the compile process by disabling:
-RUN_USERPRGM

If anyone would like to test the web debugger on my demo server, you may follow the link:
http://devyash.noip.me:2014
For an idea on how much CPU it is consuming, my RasPi (which is running this) is idling at 3% CPU usage. When it starts getting flooded with responses, it maxes out at about 30% CPU (tested using ab (Apache benchmark))!

Last edited by yash101 : 03-10-2014 at 01:10.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi