title: Java <-> C Bridge
body: <p>I'm working on a application which has Java web interface hosted on Glassfish server and C kernel which is implemented as Linux daemon.</p>
  
  <p>My biggest problem right now is how to make Remote Procedure Calls. I need to call functions and methods in both directions. These are the possible solutions that I can think of:</p>
  
  <ol>
  <li>Use Java Native Interface and network sockets to implement RPC.</li>
  <li>D-Bus - as far as I know DBus can be used for RPC between Java and C.</li>
  </ol>
  
  <p>I want to use the most basic way without using external libraries or frameworks.
  Is it possible directly to call functions/methods between Java and C using only sockets? The OS that I use is Centos.</p>
  
  <p>Is there more elegant way to connect the two languages?</p>