title: How to make socket emit command as synchronous function?
body: <p>In this code, the program get uptime details from Linux server by using Node.js.</p>
  
  <pre><code>socket.emit("getuptime",{host:"192.168.*.*"});
  $("#result").html("loading....");
  socket.on("getuptimeresult",function(data){
     console.log("result = "+data);
  });
  </code></pre>
  
  <p>Here, the second line code should execute only first line code fully completed. I am not sure when exactly get the result from the node. So I want to get it immediately after socket emits the code. Are there any possibilities?  </p>