Is it possible to change my server code without having to compile?

2

Well I was thinking of something, I have a program that is hosted in linux and through an executable, my clients have access, every modification I make in the server code I have to compile again to take effect, this makes it impossible my clients to connect, depending on the maintenance time, it takes about 4 hours, so I was thinking, is it possible for me to make some way for me to change the server code and the updates to take effect with the clients logged in? p>     

asked by anonymous 16.05.2015 / 18:15

2 answers

1

So what's happening, my friend, is that you're using the wrong dynamics for your server.

Answering your first question, no - there is no way to do this without compiling because C is not a scripting language. This is why most servers use either PHP or (lately) Python.

If you continue to use C, it is recommended that you use a kind of tree of features (eg the program loads several DLLs and runs each one with its own characteristic), thus saving time to change the server. It's explicit that there are several ways to approach the case, and in fact: C is not the best option for a server that will be changed all the time . Even so, as the subject is vague, I leave my tip.

    
18.05.2015 / 02:00
1
The compiling of a C / C ++ program involves three main steps: pré-processador , compilação and linkagem

  • Pre Processor:
The preprocessor is the first stage of the build, it examines the written source program and performs certain modifications, based on compilation directives.

  • Join lines that have been separated by escape sequences.
  • Removes comments and replaces them with whitespace
  • Expands macros
  • Process preprocessing policies
So the preprocessor modifies the source program, which would not yet be ready to be delivered to the compiler .

  • Compiler:
The compiler processes the preprocessor result and for each compilation unit it generates an object file. it consists of verifying that the code is well constructed according to the language grammar . After checking that there is no error syntactic or semantic it can then generate the code in machine language .

  • Linkage:

Finally, after preprocessing , compiling each source file and generating all the object files we can invoke the linker . The linker is responsible for joining all of the object files and generating the executable file (can also be used to generate dynamic libraries, such as dlls ).

  

With the data obtained above, we are aware of how the compilation   works and how the exeuttable file is generated, and with that baggage   we realized that CAN NOT change an executable code   without the compilation.

     

What you might be doing is setting a time for MAINTENANCE   on your daily server, so always at that time customers would be   disconnected and the updates would be made!

    
18.05.2015 / 19:58