• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what could possibly cause a UDP Socket server to be closed ?

 
Ranch Hand
Posts: 143
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi...

we have a socket server which accepts around 27 multiple client connection from different devices (Access Points if you must know) , the problem is, that on a specific machine running windows 2008 sr2, these sockets tend be closed down almost a few seconds after it's open with the exception of:
java.net.SocketException: socket closed
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:145)
at java.net.DatagramSocket.receive(DatagramSocket.java:725)
at aeroscout.dev.net.UdpServerProtocol.receive(UdpServerProtocol.java:70)
.

and
java.net.SocketException: Socket is closed
at java.net.DatagramSocket.send(DatagramSocket.java:590)
at aeroscout.dev.net.UdpServerProtocol.send(UdpServerProtocol.java:90)
at aeroscout.dev.net.CommTerminal$DataWriter.run(CommTerminal.java:380)

a few things.

this is java 6.

if you try to open around 2 connections that won't happen, we don't exactly the threshold that starts to break connections.

the machines also have an IPV6 card, but we are not using it.

the machines didn't receive any updates (it's not even connected to the internet) from 09/2012, the issues started from 02/2013

the event log doesn't have any special errors i should notice.
this is the netstat of the active connections we have:

Active Connections

Proto Local Address Foreign Address State PID
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 716
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1411 0.0.0.0:0 LISTENING 5444
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING 4444
TCP 0.0.0.0:1919 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:1920 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:1921 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:1922 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:2160 0.0.0.0:0 LISTENING 1504
TCP 0.0.0.0:2161 0.0.0.0:0 LISTENING 1468
TCP 0.0.0.0:2260 0.0.0.0:0 LISTENING 1504
TCP 0.0.0.0:3052 0.0.0.0:0 LISTENING 1468
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 2836
TCP 0.0.0.0:6547 0.0.0.0:0 LISTENING 1468
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:8082 0.0.0.0:0 LISTENING 5444
TCP 0.0.0.0:8800 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:8801 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 440
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 868
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 916
TCP 0.0.0.0:49187 0.0.0.0:0 LISTENING 536
TCP 0.0.0.0:49281 0.0.0.0:0 LISTENING 484
TCP 0.0.0.0:49293 0.0.0.0:0 LISTENING 3124
TCP 0.0.0.0:50558 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:50568 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:50578 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:61616 0.0.0.0:0 LISTENING 1588
TCP 0.0.0.0:61617 0.0.0.0:0 LISTENING 5444
TCP 10.8.100.236:139 0.0.0.0:0 LISTENING 4
TCP 10.8.100.236:2161 10.8.100.236:49188 ESTABLISHED 1468
TCP 10.8.100.236:8080 10.8.110.107:52006 ESTABLISHED 1588
TCP 10.8.100.236:8080 10.8.110.121:51001 ESTABLISHED 1588
TCP 10.8.100.236:8080 10.8.115.118:49661 ESTABLISHED 1588
TCP 10.8.100.236:8080 10.8.125.111:51129 ESTABLISHED 1588
TCP 10.8.100.236:8080 10.8.131.151:56069 ESTABLISHED 1588
TCP 10.8.100.236:49188 10.8.100.236:2161 ESTABLISHED 1504
TCP 10.8.100.236:50568 10.8.100.236:50647 ESTABLISHED 1588
TCP 10.8.100.236:50592 10.8.100.236:61616 ESTABLISHED 1588
TCP 10.8.100.236:50593 10.8.100.236:61616 ESTABLISHED 1588
TCP 10.8.100.236:50647 10.8.100.236:50568 ESTABLISHED 1588
TCP 10.8.100.236:61616 10.8.100.236:50592 ESTABLISHED 1588
TCP 10.8.100.236:61616 10.8.100.236:50593 ESTABLISHED 1588
TCP 10.8.185.10:139 0.0.0.0:0 LISTENING 4
TCP 127.0.0.1:1411 127.0.0.1:50542 TIME_WAIT 0
TCP 127.0.0.1:1411 127.0.0.1:50576 ESTABLISHED 5444
TCP 127.0.0.1:1411 127.0.0.1:50584 ESTABLISHED 5444
TCP 127.0.0.1:1433 127.0.0.1:50546 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50547 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50548 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50549 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50550 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50551 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50552 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50553 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50554 ESTABLISHED 4444
TCP 127.0.0.1:1433 127.0.0.1:50555 ESTABLISHED 4444
TCP 127.0.0.1:8005 0.0.0.0:0 LISTENING 1588
TCP 127.0.0.1:8080 127.0.0.1:50589 ESTABLISHED 1588
TCP 127.0.0.1:8080 127.0.0.1:50652 FIN_WAIT_2 1588
TCP 127.0.0.1:8080 127.0.0.1:50653 FIN_WAIT_2 1588
TCP 127.0.0.1:31001 127.0.0.1:32000 ESTABLISHED 5444
TCP 127.0.0.1:32000 0.0.0.0:0 LISTENING 5080
TCP 127.0.0.1:32000 127.0.0.1:31001 ESTABLISHED 5080
TCP 127.0.0.1:49191 127.0.0.1:49192 ESTABLISHED 1468
TCP 127.0.0.1:49192 127.0.0.1:49191 ESTABLISHED 1468
TCP 127.0.0.1:49194 0.0.0.0:0 LISTENING 4444
TCP 127.0.0.1:50167 0.0.0.0:0 LISTENING 1468
TCP 127.0.0.1:50546 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50547 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50548 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50549 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50550 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50551 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50552 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50553 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50554 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50555 127.0.0.1:1433 ESTABLISHED 1588
TCP 127.0.0.1:50562 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50564 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50565 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50566 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50569 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50570 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50571 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50572 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50576 127.0.0.1:1411 ESTABLISHED 1588
TCP 127.0.0.1:50582 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50584 127.0.0.1:1411 ESTABLISHED 1588
TCP 127.0.0.1:50586 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50589 127.0.0.1:8080 ESTABLISHED 1588
TCP 127.0.0.1:50596 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50597 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50598 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50599 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50600 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50611 127.0.0.1:61616 ESTABLISHED 1588
TCP 127.0.0.1:50652 127.0.0.1:8080 CLOSE_WAIT 3712
TCP 127.0.0.1:50653 127.0.0.1:8080 CLOSE_WAIT 3712
TCP 127.0.0.1:50655 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50656 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50657 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50658 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50659 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50660 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50661 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:50662 127.0.0.1:8080 TIME_WAIT 0
TCP 127.0.0.1:61616 127.0.0.1:50562 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50564 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50565 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50566 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50569 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50570 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50571 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50572 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50582 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50586 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50596 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50597 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50598 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50599 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50600 ESTABLISHED 1588
TCP 127.0.0.1:61616 127.0.0.1:50611 ESTABLISHED 1588
TCP 127.0.0.1:61617 127.0.0.1:50543 TIME_WAIT 0
TCP [::]:135 [::]:0 LISTENING 716
TCP [::]:443 [::]:0 LISTENING 1588
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:1411 [::]:0 LISTENING 5444
TCP [::]:1433 [::]:0 LISTENING 4444
TCP [::]:1919 [::]:0 LISTENING 1588
TCP [::]:1920 [::]:0 LISTENING 1588
TCP [::]:1921 [::]:0 LISTENING 1588
TCP [::]:1922 [::]:0 LISTENING 1588
TCP [::]:2160 [::]:0 LISTENING 1504
TCP [::]:2161 [::]:0 LISTENING 1468
TCP [::]:2260 [::]:0 LISTENING 1504
TCP [::]:3052 [::]:0 LISTENING 1468
TCP [::]:3389 [::]:0 LISTENING 2836
TCP [::]:8082 [::]:0 LISTENING 5444
TCP [::]:8800 [::]:0 LISTENING 1588
TCP [::]:8801 [::]:0 LISTENING 1588
TCP [::]:47001 [::]:0 LISTENING 4
TCP [::]:49152 [::]:0 LISTENING 440
TCP [::]:49153 [::]:0 LISTENING 868
TCP [::]:49154 [::]:0 LISTENING 916
TCP [::]:49187 [::]:0 LISTENING 536
TCP [::]:49281 [::]:0 LISTENING 484
TCP [::]:49293 [::]:0 LISTENING 3124
TCP [::]:50558 [::]:0 LISTENING 1588
TCP [::]:50568 [::]:0 LISTENING 1588
TCP [::]:50578 [::]:0 LISTENING 1588
TCP [::]:61616 [::]:0 LISTENING 1588
TCP [::]:61617 [::]:0 LISTENING 5444
TCP [::1]:49194 [::]:0 LISTENING 4444
UDP 0.0.0.0:123 *:* 968
UDP 0.0.0.0:500 *:* 916
UDP 0.0.0.0:1434 *:* 1976
UDP 0.0.0.0:2160 *:* 1504
UDP 0.0.0.0:2161 *:* 1468
UDP 0.0.0.0:4500 *:* 916
UDP 0.0.0.0:5355 *:* 156
UDP 0.0.0.0:7846 *:* 1468
UDP 0.0.0.0:12091 *:* 5444
UDP 0.0.0.0:12092 *:* 5444
UDP 0.0.0.0:37008 *:* 5444
UDP 0.0.0.0:56622 *:* 1468
UDP 10.8.100.236:137 *:* 4
UDP 10.8.100.236:138 *:* 4
UDP 10.8.185.10:137 *:* 4
UDP 10.8.185.10:138 *:* 4
UDP 127.0.0.1:54615 *:* 916
UDP 127.0.0.1:55884 *:* 3712
UDP 127.0.0.1:62758 *:* 4356
UDP 127.0.0.1:62965 *:* 1912
UDP 127.0.0.1:64544 *:* 156
UDP 127.0.0.1:65166 *:* 536
UDP [::]:123 *:* 968
UDP [::]:500 *:* 916
UDP [::]:1434 *:* 1976
UDP [::]:2160 *:* 1504
UDP [::]:2161 *:* 1468
UDP [::]:4500 *:* 916
UDP [::]:7846 *:* 1468
UDP [::]:12091 *:* 5444
UDP [::]:12092 *:* 5444
UDP [::]:37008 *:* 5444
UDP [::]:56622 *:* 1468



 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

We have the same issue, did you get any further with this issue?
Any help would be appreciated!

BR
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

First, with UDP sockets, there is no concept of open/close, as UDP sockets are connectionless.

Having said that, if memory serves, I believe the DatagramSocket class merely maintains a state variable, to report whether a socket is open or closed. And the only way to "close" the socket is to call the close() method. In other words, I would recommend looking into your code, as it is likely closed by some code in your application.

Henry
 
Ali Fakhraee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Henry for your time! This is what confuses us a lot, there is no trace in the application code that call close() method in this case.

Ali
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Not sure what trace you are referring to -- are you talking about the stack trace at the time of the error? If so, that won't help you, as the socket could have been closed much earlier than the time of the error.

Also, the socket supports many interfaces, such as the channel and closeable stuff. This means that if may be closed indirectly by any infrastructure, or wrapper/filter libraries, that you may be using.

If you are running with a debugger, perhaps it may help to put a break point on the close() method?  Other than that, I am not sure what else to recommend.

Henry
 
reply
    Bookmark Topic Watch Topic
  • New Topic