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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:13:38+00:00 2026-05-17T06:13:38+00:00

I am working on a application which sends UDP packet to initiate a Processing

  • 0

I am working on a application which sends UDP packet to initiate a Processing and needs to send back response on same socket after 3-5 minutes, but issue is that when response is sent back, it never reaches client.
I am using java. Any suggestions, how we can keep the socket alive over longer period of time?

—

  • 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-17T06:13:38+00:00Added an answer on May 17, 2026 at 6:13 am

    Any suggestions, how we can keep the socket alive over longer period of time?

    and

    Is there a way to set UDP timeout setting …?

    UDP is connectionless. If an application binds to a UDP server-socket and listens, it can wait for messages to arrive indefinitely.

    The flipside is that there is no way to detect a lost UDP message at the protocol / socket level. If one machine sends a UDP message to another one, the first machine has no direct way of knowing if the message has arrived or not? There are no transport level timeouts to tell the sender to retransmit.

    If you need reliability, timeouts, automatic retransmission, etc, you are better of using a connection-based transport protocol such as TCP.

    Issue as suggested by a colleague, might be that firewall closes UDP connections if there is no activity for certain period of time, for communication to be reliable one need to implement timeout probe.

    On the face of it, that explanation is nonsensical. UDP is connectionless, so there is no connection to close, or to keep alive.

    The real explanation is likely to be one of the following:

    • The UDP requests or the UDP replies are being blocked by firewall software on one or other of the machines, or somewhere in the network.

    • Something is not right about the way that the messages are being sent or received.

    • You are trying to send UDP messages through a NAT gateway; e.g. to a machine whose IP address cannot be routed from the other. Special measures such as UDP hole punching are required to get UDP traffic to a NATed host, and it may be necessary to send keep-alive packets to keep a “UDP hole” from timing out.

    If you are trying to send UDP through a NAT firewall from Java, there are various (3rd-party) Java libraries for doing this. Search for “stun” and “turn” or “ice” together with “java” and “udp”, or read the following for a started:

    • STUN, TURN, ICE library for Java

    These solutions all require you to take steps to “refresh” the NAT bindings to keep the firewall “hole” open.

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

Sidebar

Related Questions

I am working on an application which sends an AJAX POST request (I'm using
Presently I am working on an application which sends and receives file from remote
I am working on a sample application which sends file to other device. I
In my application I have two threads a main thread which is busy most
I'm working on an application that contains several server sockets that each run in
I want to write a small utility in MFC which sends the Ctrl +
I've developed some software on my Desktop which runs Windows 7 and the software
Over the last couple of months I've been working on some implementations of sockets
This is a slightly obscure question, but I'm stumped and I thought maybe somebody
Overview: I have set up a server and a client, where both attempt discovery

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.