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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:42:03+00:00 2026-06-04T10:42:03+00:00

I am trying to communicate with my Minecraft server on the RCON port. I

  • 0

I am trying to communicate with my Minecraft server on the RCON port.

I have little clue how to use the sockets & streams stuff though.
Poking around, I found they all have something in common. Socket, InputStream & OutputStream.

I tried it in my code, but the return says nothing useful.
I know the code actually sends a packet out, because I get an acknowledgement from the server console [Rcon connection from: /1.2.3.4].

Its just the code I tried to assemble based on the interwebs returns something like [B@4053f750 from output. No idea what that is, nor can I search it in Google.

Can someone give a good site for explaining this stuff?

Thanks a bunch.

Socket s;
InputStream i;
DataInputStream iD;
OutputStream o;
DataOutputStream oD;

OnClickListener listenA=new OnClickListener(){
    public void onClick(View v){
        try{
            s=new Socket("MyDomain.tld", 12345);
            i=s.getInputStream();
            iD=new DataInputStream(i);
            o=s.getOutputStream();
            oD=new DataOutputStream(o);

            byte[] data=new byte[1024], packet={
                (byte)0xFE, (byte)0xFD, // Magic bytes
                (byte)0x09,                 // Challenge type
                (byte)0xde, (byte)0xad, (byte)0xbe, (byte)0xef  // Your ID token
            };


            o.write(packet);
            i.read(data, 0, 1024);

            guiMain.setTxt_Edit(encodeCArray(data.toString())); // returns a hex string to an edit box. I can then compare the packet to what I expect.

            s.close();
        }catch(UnknownHostException e){
            e.printStackTrace();
        }catch(IOException e){
            e.printStackTrace();
        }
    }
};
  • 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-04T10:42:05+00:00Added an answer on June 4, 2026 at 10:42 am

    Try instead:

    guiMain.setTxt_Edit(encodeCArray(new String(data)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a server I am trying t communicate to and it requires the
I have been trying to communicate between two CodeIgniter projects. I have 2 projects,
I am currently trying to communicate a parent process which should have multiple children
I have an applet that throws this exception when trying to communicate with the
I am trying to build a simple server to communicate with Arduino and store
I'm trying to communicate to a device using RS-485 through the serial port. Everything
I am trying to communicate with Excel from a Java/SWT application. I have been
I have a USB device I'm trying to communicate with over a virtual serial
I have read though many different examples but I am currently having difficulties trying
I am trying to communicate with a cash register through the serial port from

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.