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 6473955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:31:41+00:00 2026-05-25T06:31:41+00:00

I created a really simple Java program that creates a java.net.ServerSocket on an open

  • 0

I created a really simple Java program that creates a java.net.ServerSocket on an open port, x, and waits for a connection using accept (). I want to use telnet/ssh to connect to the program via port x so that I can communicate with said program. My problem is after I connect to the port, my program recognizes and accepts the connection, but ssh freezes. I’m assuming this is because I don’t have the proper response. I just wanna know what I should be doing next. How do I respond?

I could use a library, but I’d like to understand what should come next. However, I would still really appreciate someone telling me if I really should be using a library. Also, I know some basic networking concepts like TCP/IP, OSI, and that data gets wrapped, sent, then unwrapped, but that’s the extent of my networking knowledge.

  • 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-25T06:31:42+00:00Added an answer on May 25, 2026 at 6:31 am

    ssh is probably much too complicated for what you want to achieve. It freezes because it waits for a response from your server that it probably never gets. ssh has also complicated security requirements that you probably don’t want to implement for your simple server.

    Why don’t you start with something very basic on the client side as in this tutorial. From there on, you can still add features and functionality as needed.

    Edit:

    Sending commands with telnet:

    Client Side:

    Just issue telnet host port, there you type say Hello World and hit Enter.

    Server side:

    You receive a stream of bytes from your client. First you have to parse it as a String. Then you could simply split this String by looking for the first whitespace character. The string before that is your ‘command’, the part after the whitespace is your ‘payload’.

    In the example this would give you ‘say’ as the command and ‘Hello World’ as the payload.

    Then compare the ‘command’ with a list of known commands, and based on what command you have you can then execute it with the payload as an argument.

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

Sidebar

Related Questions

I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I created a simple .NET windows application in Visual Studio 2005 and on just
I want to create a simple bash script to launch a Java program on
I've programmed for a while in Java and .Net, but never really used C
The issue is simple really. Instead of creating folders in Visual Studio, I create
I created a few mediawiki custom tags, using the guide found here http://www.mediawiki.org/wiki/Manual:Tag_extensions I
Sorry for really simple question, but I wasnt able to find anything in the
I'm trying to send keystrokes from my C# program to a Java application The
From this rpg socket tutorial we created a socket client in rpg that calls
I'm new to Android and Java programming and I've manage to create a simple

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.