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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:21:14+00:00 2026-06-01T03:21:14+00:00

Using Java sockets, I made a simple server. This works because it sends data

  • 0

Using Java sockets, I made a simple server. This works because it sends data whenever I enter in the address (192.168.1.68:54321) into another computer’s web browser. But when I attempt to connect to the server using a Java socket, it times out.

Client connect code:

public void connect() throws IOException {
        socket = new Socket(ip, port); // times out here
        socket.setKeepAlive(true);
        in = new ObjectInputStream(socket.getInputStream());
        out = new ObjectOutputStream(socket.getOutputStream());
        t = new Thread(this);
        run = true;
        t.start();
}

What is a solution to this problem?

  • 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-01T03:21:16+00:00Added an answer on June 1, 2026 at 3:21 am

    What is a solution to this problem?

    It depends on what the problem is. But I expect it is one (or more) of the following:

    1. The client is using the wrong IP address.
    2. The client is using the wrong port number.
    3. The server is not running.
    4. There is a physical network connectivity issue, or a routing problem.
    5. The connection is being blocked by a firewall issue, on the client, the server or somewhere in the network.

    Of these, I think that the last is the most likely.

    (Note that many of these issues are more likely to result in a different failure mode; i.e. an immediate failure rather than a connection timeout. However, that depends on a variety of details about your environment, some of which are likely to be opaque to you.)


    The rest shouldn’t be problems since it works on the same computer as my client when I use a web browser.

    You are mistaken. Your web browser will NOT be successfully connecting to your service. The service on 54321 doesn’t implement HTTP, so your browser can’t fetch pages from it.

    Firewall rules for TCP and UDP tend to be specific to the ports that you are trying to use. The fact that your web browser can talk to the server on (I expect) ports 80 and 443 says NOTHING about whether something else can connect on some other port. And there is the further complication that your web browser could be configured (or auto-configured) to use a web proxy, and that could mean that it is not talking to that host directly at all.

    Given what you’ve said, it is highly likely to be a firewall related problem. That is my best answer.

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

Sidebar

Related Questions

I made a networked game in Java using Sockets. It works great, except... only
I have implemented a Kerberos server/client using sockets in Java, where the client sends
I'm currently writing a simple client/server in Java using sockets. I want the server
I made a simple server written in java which simply sends the html code
I need to create 1000 server sockets using Java. Somewhere between creating 600 and
I have a java server which is using TCP and sockets to connect to
I'm using Java sockets for client - server application. I have a situation when
I am building a client server application using Java Sockets (in Windows XP). For
I'm trying to build a simple HTTP Server using Java, using java.net.ServerSocket = new
hello i have a basic client-server system running using java sockets. my problem is,

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.