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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:16:48+00:00 2026-05-30T11:16:48+00:00

I’m trying to make a basic datagram client/server program with Java. I’ve made the

  • 0

I’m trying to make a basic datagram client/server program with Java.

I’ve made the server cling to port 9321 on my local computer.

I’ve made the client on port 9320 on my local computer,
then send the data over wireless router network (192.168.1.100) at port 9321
the program works!

then i try to send the packet over (via router)internet IP 139.195.12.183(my ip) at port 9321
but it didnt work!
there is this exception:

java.net.SocketException: Interrupted function call: Datagram send failed

i’ve set the router to forward any request for port 9321 to my computer
and then i’ve set exception for the firewall on my computer on that port

this is the source

String SERVER = "139.195.12.183";

sendString(SERVER, 9321, "Greetings"); <<


private void sendString(String IP, int port, String toSend) {
    byte[] buf = toSend.getBytes();
    DatagramPacket packet = null;
    try {

        packet = new DatagramPacket(buf, buf.length, InetAddress.getByName(SERVER), port);

        ds.send(packet);<<
    }catch(UnknownHostException e) {
        System.out.println("unknownhostception");
    }catch(IOException e) {
        System.err.println("ioception "+e.getMessage());

    }

}

i’ve had another answers from another forum it said:

“The way routers work, you can’t see your external (WAN) internet address from your
internal network (LAN). If that’s what you are trying to do, there’s nothing wrong, it
just won’t work.

Ian.”

any explanation?

  • 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-30T11:16:49+00:00Added an answer on May 30, 2026 at 11:16 am

    Some steps that you can take:

    1. Check that the code works across two machines on your LAN.
    2. Check that ping <target-ip> works on your machine.
    3. If it does, check your local and LAN firewall settings for blocking on the port/protocol.
    4. If the ports are unblocked change the port to something else. Some ISPs will block certain ports.

    Some more reasons why this error could come up:

    • UDP (I Assume?) datagram too large.
    • Client side error that doesn’t affect reception (Have seen similar things with some network stacks where the error was spurious.)

    Post a link to your code from patsebin or something if you want more info.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put

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.