Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:52:52+00:00 2026-05-14T00:52:52+00:00

I have two applications: c++ service and a RoR web server (they are both

  • 0

I have two applications: c++ service and a RoR web server (they are both running at same VPS)

I need to “send” some variables (and then do something with them) from each other. For exaple, i’m looking for something like this:

// my C++ sample
void SendMessage(string message) {
   SendTo("127.0.0.1", message);
}

void GetMessage(string message) {
   if (message == "stop")
      SendMessage("success");
}

# Ruby sample
# application_controller.rb

def stop
   @m = Messager.new
   @m.send("stop")
end

I have never used it before, and i even don’t know which technology should i search and learn.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:52:52+00:00Added an answer on May 14, 2026 at 12:52 am

    Ok, i have found the solution. Its TCP sockets:

    Ruby TCP server, to send messages:

    require 'socket'
    
    server = TCPServer.open(2000)
    loop {                       
      Thread.start(server.accept) do |client|
        client.puts(Time.now.ctime)
        client.puts "Closing the connection. Bye!"
        client.close               
      end
    
    }
    

    Ruby client, to accept messages:

    require 'socket'
    
    host = 'localhost'
    port = 2001 # it should be running server, or it will be connection error
    
    s = TCPSocket.open(host, port)
      while line = s.gets
        puts line.chop
      end
    s.close
    

    Now you should write TCP-server+client in another application. But you have got the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two web applications running in the same Tomcat Instance. In one of
I have two web applications in the same server like this: /basedir/app1path/default1.aspx /basedir/app2path/default2.aspx How
I have two applications under tomcat/webapps folder. tomcat/webapps/App1 tomcat/webapps/App2 Both applications share the same
If you have two applications residing on the same server, can you use Server.Transfer
I have two web applications and both are developed in ASP.NET. Now I want
I have two applications, a WinForms app and a Windows Service that will both
The scenario is this We have two applications A and B, both which are
Here's the thing: I have two applications, written in C++ and running on two
We have two servers, both are containing a local application connecting to local web
I have two applications written in Java that communicate with each other using XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.