0

I'm looking for something,I don't know if it exists.

I have a Java server, something like

while (true) {
            try {
                Socket socket = server.accept();
                new ConnectionHandler(socket);
                System.out.println("Waiting for a new client message...");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

What I need, is to do a unix client to connect to this server. I need only to send a message, and my server will launch a process. Is there a way to build a unix client ?

1
  • The idea is not to build a java client, but to build a unix one. This is mandatory. If is too complicated in unix, then I will re consider my choice. Commented Jun 30, 2010 at 16:09

2 Answers 2

1
  • At least for testing, you could use telnet to connect to your service, and issue text commands.

  • Netcat could be used as well, just give it the IP address and port where your Java server is running. e.g.

    echo "My Message" | nc 192.168.1.42 10001

  • Build your own client in Java.

Sign up to request clarification or add additional context in comments.

3 Comments

I don't want a Java client. That's the thing.
Ok, then go with any of the first 2 options, or explain further what you actually want(e.g. do you want to build your own client, in C, C++,Python, something else ?)
Actually, I would like to know if there is something native to do that. If no, I will build my own java client.
0

If you don't want to develop a client in Java you could consider the unix nc (netcat) command. It's a veritable swiss-army knife of TCP and UDP.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.