Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 44236 invoked from network); 15 Jul 2009 11:47:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jul 2009 11:47:30 -0000 Received: (qmail 85922 invoked by uid 500); 15 Jul 2009 11:47:40 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 85873 invoked by uid 500); 15 Jul 2009 11:47:40 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 85810 invoked by uid 99); 15 Jul 2009 11:47:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 11:47:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 11:47:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2D12F234C051 for ; Wed, 15 Jul 2009 04:47:15 -0700 (PDT) Message-ID: <6647020.1247658435183.JavaMail.jira@brutus> Date: Wed, 15 Jul 2009 04:47:15 -0700 (PDT) From: "Francesco Furfari (JIRA)" To: dev@felix.apache.org Subject: [jira] Closed: (FELIX-657) Devices get lost after a certain period of time (SSDP sockets do not get closed properly in cyberlink lib) In-Reply-To: <324979722.1217839544557.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FELIX-657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Francesco Furfari closed FELIX-657. ----------------------------------- Resolution: Fixed Fixed in CyberDomo 1.9 > Devices get lost after a certain period of time (SSDP sockets do not get closed properly in cyberlink lib) > ---------------------------------------------------------------------------------------------------------- > > Key: FELIX-657 > URL: https://issues.apache.org/jira/browse/FELIX-657 > Project: Felix > Issue Type: Bug > Components: UPnP Subproject > Affects Versions: upnp-basedriver-0.8.0 > Reporter: Daniel Felsing > Fix For: upnp-basedriver-0.8.0 > > > Under Linux Systems every Socket uses a "file descriptor" in the system > which is in most unix systems default value of 1024 max descriptors. > Now i tried to push that value to 65535 and vuala everything is running > 8 > hours. > If i check my open file descriptors with lsof -p pidofmyjavaprogram i see > now MANY open ports that have not been closed properly (right now > 1400 for > 10 hours of operation). > Ok..that made me let a bit deeper into the code of cyberlink library. > I saw a fix that was introduced by someone because of "non-closed" ssdp udp > sockets in the announce method of org/cybergarage/upnp/Device.java > 1240 SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr); > 1241 > 1242 SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest(); > 1243 ssdpReq.setServer(UPnP.getServerName()); > 1244 ssdpReq.setLeaseTime(getLeaseTime()); > 1245 ssdpReq.setLocation(devLocation); > 1246 ssdpReq.setNTS(NTS.ALIVE); > 1247 > 1248 // uuid:device-UUID(::upnp:rootdevice)* > 1249 if (isRootDevice() == true) { > 1250 String devNT = getNotifyDeviceNT(); > 1251 String devUSN = getNotifyDeviceUSN(); > 1252 ssdpReq.setNT(devNT); > 1253 ssdpReq.setUSN(devUSN); > 1254 ssdpSock.post(ssdpReq); > 1255 > 1256 String devUDN = getUDN(); > 1257 ssdpReq.setNT(devUDN); > 1258 ssdpReq.setUSN(devUDN); > 1259 ssdpSock.post(ssdpReq); > 1260 } > 1261 > 1262 // > uuid:device-UUID::urn:schemas-upnp-org:device:deviceType:v > 1263 String devNT = getNotifyDeviceTypeNT(); > 1264 String devUSN = getNotifyDeviceTypeUSN(); > 1265 ssdpReq.setNT(devNT); > 1266 ssdpReq.setUSN(devUSN); > 1267 ssdpSock.post(ssdpReq); > 1268 > 1269 // Thanks for Mikael Hakman (04/25/05) > 1270 ssdpSock.close(); > Ok seems fine so far... > Ok now i looked into org/cybergarage/upnp/Service.java and there the "socket > close fix" was NOT introduced for both announce and byebye..... > 599 public void announce(String bindAddr) > 600 { > 601 // > uuid:device-UUID::urn:schemas-upnp-org:service:serviceType:v > 602 Device rootDev = getRootDevice(); > 603 String devLocation = rootDev.getLocationURL(bindAddr); > 604 String serviceNT = getNotifyServiceTypeNT(); > 605 String serviceUSN = getNotifyServiceTypeUSN(); > 606 > 607 Device dev = getDevice(); > 608 > 609 SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest(); > 610 ssdpReq.setServer(UPnP.getServerName()); > 611 ssdpReq.setLeaseTime(dev.getLeaseTime()); > 612 ssdpReq.setLocation(devLocation); > 613 ssdpReq.setNTS(NTS.ALIVE); > 614 ssdpReq.setNT(serviceNT); > 615 ssdpReq.setUSN(serviceUSN); > 616 > 617 SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr); > 618 Device.notifyWait(); > 619 ssdpSock.post(ssdpReq); > // PLACE FIX HERE (by Daniel) > ssdpSock.close(); > 620 } > 622 public void byebye(String bindAddr) > 623 { > 624 // > uuid:device-UUID::urn:schemas-upnp-org:service:serviceType:v > 625 > 626 String devNT = getNotifyServiceTypeNT(); > 627 String devUSN = getNotifyServiceTypeUSN(); > 628 > 629 SSDPNotifyRequest ssdpReq = new SSDPNotifyRequest(); > 630 ssdpReq.setNTS(NTS.BYEBYE); > 631 ssdpReq.setNT(devNT); > 632 ssdpReq.setUSN(devUSN); > 633 > 634 SSDPNotifySocket ssdpSock = new SSDPNotifySocket(bindAddr); > 635 Device.notifyWait(); > 636 ssdpSock.post(ssdpReq); > // PLACE FIX HERE (by Daniel) > ssdpSock.close(); > 637 } > kind regards, > Daniel -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.