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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:03:53+00:00 2026-05-26T20:03:53+00:00

I am implementing a socket in Java for communicating with VMware-Workstation (Version: 8.0.0 build-471780).

  • 0

I am implementing a socket in Java for communicating with VMware-Workstation (Version: 8.0.0 build-471780).

I create the socket with: Socket socket = new Socket("localhost",8832);, since I’m running the virtual machine locally and 8832 is the port that VMware listens for debugging by defalut.
The connection is not being refused or throwing any kind of exceptions.
However, I’m in trouble to establish a communication between my process and the VMware stub.

These methods are not effectively sending or receiving anything from the stub:

public void sendStr(String str) throws IOException {
        out.write(str.getBytes());
}
public String getStr() throws IOException, ClassNotFoundException {//blocking call
    byte[] byteArray = new byte[40];
    in.read(byteArray);
    return new String(byteArray);
}

The second method never ends, since it’s a blocking call.

When i terminate the Java process, my virtual machine notices the lost of debugger connection, so I’m able to say that the connection was succesfully made.

Can someone help me here? I don’t know what to do anymore.

  • 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-26T20:03:53+00:00Added an answer on May 26, 2026 at 8:03 pm

    Can you try running the program in the same system, without using the Virtual Machine?

    Its not save to ignore the return value of read as it may not read the full length. Your application could hang if you expect to receive the same number of “messages” as you send. This is because a Socket is a stream of bytes and you can have any number of sent strings combine or split.

    A safer approach is to use DataOutput/InputStreams

    final DataOutputStream out = 
    
    public void sendStr(String str) throws IOException {
        out.writeUTF(str);
    }
    
    final DataInputStream in = 
    
    public String getStr() throws IOException {//blocking call
        return in.readUTF(); // will return exactly on string.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing a node.js server that manages bi-connections between users with socket.io (version:0.8.7). I
I'm implementing a java TCP/IP Server using ServerSocket to accept messages from clients via
I am implementing a really basic server-client model in Java, by using UDP sockets
I want to create a socket for accessing IPv4 packets from data link layer.
I am using protobuf for implementing a communication protocol between a Java application and
We are implementing a C# application that needs to make large numbers of socket
I am implementing basic socket program , but in this case i want the
I have a Java Thread which handles outgoing communication with a Socket . I
I am implementing a profiler which collects data and sends the data via socket
I am implementing a small library to make the use of System.Net.Sockets.Socket easier. It

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.