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

  • SEARCH
  • Home
  • 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 9228851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:25:40+00:00 2026-06-18T05:25:40+00:00

I have a third party server which I can connect to (on my local

  • 0

I have a third party server which I can connect to (on my local network) to do some neat things I need to do for a project I am working on. I use a Java library provided by the third party to o all of the connection stuff, and I can successfully send commands to the server using their code. Their code also provides some event listener interfaces which I am able to implement in order to get status changes from the server, as long as my program is running. What I would like to do is create a program which will just run as (or like) a service listening perpetually from events on the server and writing them to a database, but I also need to be able to listen for connections from my local machine so I can use a command line program to tell my service to send messages to the server (the server only allows one connection at a time).

I have looked (briefly) at JMS as well as RMI, but they both seem like they may be much more complicated and heavyweight than what I think I need to communicate locally. Is there a method that is simpler for sending simple messages (and by simple I mean a single pipe delimited string would do the trick) between two running applications on the same machine?

  • 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-06-18T05:25:42+00:00Added an answer on June 18, 2026 at 5:25 am

    You could use sockets for interprocess communication if you want something simpler than RMI and JMS.

    The java tutorial on sockets might be a good place to start.

    A simple one message client-server where the server waits until a client joins and then receives a message from the client could look like this:

    public class SocketsServer {
    
        public static void main(String[]rags) throws Exception
        {
            ServerSocket ss1 = new ServerSocket();
            ss1.bind(new InetSocketAddress("localhost",9992));
            //accept blocks until someone connects
            Socket s1 = ss1.accept();
            BufferedReader br = new BufferedReader(new InputStreamReader(s1.getInputStream()));
            String line;
            while( (line = br.readLine()) != null )
            {
                System.out.println(line);
            }
            s1.close();
            ss1.close();
        }
    }
    

    And for Client side:

    public class SocketsClient {
    
        public static void main(String[]args) throws Exception
        {
            Socket ss = new Socket();
            ss.connect(new InetSocketAddress("localhost", 9992));
            PrintWriter pw = new PrintWriter(ss.getOutputStream(), true);
            pw.println("hello socket");
            ss.close();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a project A with a third party dependency B which lives
I have a third-party product, a terminal emulator, which provides a DLL that can
I have third party sites that link to some images on my site. The
I have a third party DLL i need to call from my C# program.
I have a third party component I'm using and I'm seeing some issues with
I have a third party SDK in C# which has class names like this:
I have a third-party library (the interface to Xerox's Finite State tools) which come
I have some third-party Javascript that has statements like this: FOO = function() {
I have a Java application which uses a third-party COM component through a Java-COM
I have a third party .Net web application (Sitecore) which connects to an Oracle

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.