ServerSocket bind, bug or windows feature

I wanted to check if a TCP socket was already bound before attempting to use it.
I had my own ideas, but looked for other ideas as well.
While testing these other ideas I stumbled on the following issue.
On Windows XP(SP3), its the work platform of choice, I noted the following from a netstat:
$ netstat -an|grep 139
TCP 10.11.13.98:139 0.0.0.0:0 LISTENING
TCP 192.168.56.1:139 0.0.0.0:0 LISTENING
TCP 192.168.113.1:139 0.0.0.0:0 LISTENING
TCP 192.168.231.1:139 0.0.0.0:0 LISTENING
Note that this is the Windows 'NETBIOS Session Service' of course and that it is bound to all my machines interfaces except for the loopback.
If I execute the following call:
ServerSocket anyAddressSocket = new ServerSocket(139, 2, null);
I will not get java.net.BindException thrown.
I will see a new listener bound to port 139 and the 'any address' as follows:
$ netstat -an|grep TCP|grep 139
TCP 0.0.0.0:139 0.0.0.0:0 LISTENING
TCP 10.11.13.98:139 0.0.0.0:0 LISTENING
TCP 192.168.56.1:139 0.0.0.0:0 LISTENING
TCP 192.168.113.1:139 0.0.0.0:0 LISTENING
TCP 192.168.231.1:139 0.0.0.0:0 LISTENING
But if I replicate the situation using Java on a different arbitrary port as follows:
List<ServerSocket> sockets = new ArrayList<ServerSocket>();
Enumeration<NetworkInterface> enumOfNetworkInterfaces =
NetworkInterface.getNetworkInterfaces();
while(enumOfNetworkInterfaces.hasMoreElements())
NetworkInterface networkInterface = enumOfNetworkInterfaces.nextElement();
List<InterfaceAddress> addrs = networkInterface.getInterfaceAddresses();
for(int idx = 0; idx < addrs.size(); idx++)
InterfaceAddress intFace = addrs.get(idx);
if (!networkInterface.isLoopback())
ServerSocket socket = new ServerSocket(7777, 2, intFace.getAddress());
sockets.add(socket);
// At this point, netstat shows the same output as the first port 139 output above.
ServerSocket brokenSocketNo = new ServerSocket(7777, 2, null);
I will get the expected exception:
"java.net.BindException: Address already in use: JVM_Bind"
I am testing this with Java 6u6 which I know is old, but is what is required to be used for this product.
Is this a bug in the JVM implementation? I cannot find any reference to such in the bugs DB.
Is this a feature of Windows TCP stack?
I have not tried this on a linux platform because I am really trying to understand the issue as exhibited on the MS platform.
Any insight into this would be helpful.
Cheers Mark

Hello EJP.
Thanks for that pointer.
I tried it as you indicated and inside the loop using the following:
ServerSocket socket = new ServerSocket();
socket.setReuseAddress(true);
socket.bind(new InetSocketAddress(intFace.getAddress(), 7777), 2);
Each ServerSocket is now listening on a specific interface using the 'setReuseAddress(true);' call.
This by itself did not change the effect I see when I then make the call 'new ServerSocket(7777, 2, null)' which succeeded with port 139 but not with my port 7777 test.
If I changed the call for the for the 'wild card' address to also use 'setReuseAddress(true);' then all succeeds, but this is not the situation that succeeded with the port 139 test.
I think I am still attempting to solve the issue as a bug or a 'windows XP feature', but I am leaning more about the intricacies of sockets.
I will follow your suggestion and have a look at 'Stevens' 3rd Edition.
Cheers Mark

Similar Messages

  • Lync 2013 - re-connecting is un-muting microphone, is that a bug or a feature?

    Every time Lync 2013 re-connects (very often sadly) the microphone is un-muted.
    Is that a bug or a feature?
    I'm using a Plantronics Voyager UC headset (Lync certified), doesn't know if it happens with others too.
    Please advise if there's a solution, I have to disconnect from Lync every time I'm in a conf call using another software like Cisco Webex.
    Quite annoying and very embarassing sometimes...
    Thanks

    Hi,
    When Lync change the status of Mute/Un-Mute, it change the Audio value with the following path: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio
    Please check if Cisco Webex also use the same parameter for Mute\Un-Mute. If the two use the same parameter, it can cause the issue.
    Also, if the re-connection issue only happen to you, please try to update Lync to the latest version and then test again.
    If the re-connection issue happen for multiple users, please check the Lync Server performance and network situation as well.
    Best Regards,
    Eaosn Huang
    Eason Huang
    TechNet Community Support

  • FAQ: How do I submit a bug report or feature request or otherwise give feedback about Premiere Pro?

    The best way to submit a bug report or feature request is to use the bug-report/feature-request form.
    The Premiere Pro team doesn’t  necessarily see and record every post on every forum and social network, but we do see, record, and track every entry  through the the official feature-request/bug-report form.
    It also helps a lot if you opt into the Product Improvement Program.
    Also, be sure to use the crash reporter.
    We really do read all of the bug reports and feature  requests, and the software really does get a lot of benefit from  detailed crash reports.
    Don’t forget about contacting Adobe Technical Support or Customer  Service, too. For information on how to contact Adobe Technical Support,  see this page. (Note that you must register your product before you can open a technical support case for it.)
    If you have tried to get help from our support staff, but the service  was inadequate, I can help you to escalate your issue if you send me  your case number at kopriva at adobe dot com. You must provide me  a case number. I am not offering to solve your problem myself; rather, I  am willing to forward your information to someone if you have already  hit a dead end with our Technical Support or Customer Service.
    If you have feedback about the content of the Premiere Pro Help document,  then please add a comment at the bottom of the relevant page. You can  add comments to add information, to add links, to make corrections, or  to ask for clarification.
    If you want to keep up with the Premiere Pro team, then you can follow our blogs, Facebook page, and Twitter feed and so on.
    Oh, and I can’t resist this opportunity to remind you to update to  the most recent version of the application. Don’t be surprised when the  first thing that you hear back from us is that you need to install the  latest updates. We fix a lot of things in updates, and we don’t want to go chasing bugs that we’ve already fixed. We’ll keep you posted on our blogs, Facebook page, and Twitter feed about updates as they become available.

    Hi qwerty,
    Dun tink that creative customer support sucks cos I had been dealing with them in the past and I can say that their service are quite gd and fast. If you wanted a refund, I tink you need to contact the store that sells you the product. Dun tink creative will refund you though.

  • Is this a security bug in Windows 8.1?

    I think I have discovered a serious security bug in Windows 8.1.
    Today I was using my (non-Admin) user account and with Internet Explorer I saved a file in the default Downloads folder (under This PC). The file was saved, but when I went to that folder, the file was not there! Now, I was about to downloaded
    it again, using IE, same as before, when I noticed in the Save dialog box that the file had indeed been downloaded, and that it was there, in the Downloads folder under This PC. Frustrated, I went to that very folder, but the file was nowhere
    to be found. I was really puzzled.
    Then, by chance, while logged in another account (namely the Admin account), I happened to go to the Downloads folder, and there was the file that I had downloaded using the other account.
    Obviously, what I described above represents a security problem: firstly because my private files may get saved by mistake into another person's account without me even realizing it, and secondly because I was able to access another person account
    (i.e. the Admin account) via the IE's Save dialog box, seeing the list of the files there, and possibly even accessing them (I have not tried the latter, though).
    Has anyone experienced anything like the situation I described?
    I must also say that I later tried to replicate this abnormal behavior, but for some unknown reason I couldn't. Anyway, I am sure that what I described above is an accurate account of how things went.

    Hi,
    Since I cannot repro your issue on my own computer, it cannot be a bug.
    I suggest we try to use another user account to see if there is the same issue happened.
    Please make sure your location of download folder is right:
    Right click Downloads folder, and choose Properties.
    Make sure the location is right under your user profile.
    If not, please click Location and click Restore default.
    If we still fail to solve you issue, please run Process monitor at the end of the downloading process to capture the actions, and upload the save log here for further research.
    You can also check if there is any weird actions at the end of downloading process.
    Process Monitor v3.05
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
    How to use, please refer to this article:
    Using Process Monitor to capture system events
    http://www.sophos.com/en-us/support/knowledgebase/119038.aspx
    Keep post.
    Kate Li
    TechNet Community Support

  • Unable to install windows features on windows server 2012 core datacenter

    If I attempt to install, remove, or get windows features via powershell in windows server 2012 core datacenter I get the following error:
    PS C:\Users\BB> Invoke-Command -ComputerName CORE1 {Install-WindowsFeature Web-CertProvider}
    The given key was not present in the dictionary.
        + CategoryInfo          : NotSpecified: (:) [Install-WindowsFeature], KeyN
       otFoundException
        + FullyQualifiedErrorId : System.Collections.Generic.KeyNotFoundException,
       Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
        + PSComputerName        : CORE1
    I get the same error regardless of weather I use install-windowsfeature, remove-windowsfeature or get-windowsfeature. I've tried it on the server, and remotely.
    I've also tried managing the computer remotely using another windows 2012 server using the server manager GUI. That causes the server manager to crash with the following error:
    Problem signature:
      Problem Event Name: CLR20r3
      Problem Signature 01: servermanager.exe
      Problem Signature 02: 6.2.9200.16384
      Problem Signature 03: 50107b22
      Problem Signature 04: mscorlib
      Problem Signature 05: 4.0.30319.17929
      Problem Signature 06: 4ffa57ca
      Problem Signature 07: 210b
      Problem Signature 08: c
      Problem Signature 09: N3CTRYE2KN3C34SGL4ZQYRBFTE4M13NB
      OS Version: 6.2.9200.2.0.0.400.8
      Locale ID: 1033
      Additional Information 1: 7a77
      Additional Information 2: 7a77983701ecc7870d72712ffa4c3c88
      Additional Information 3: 0b4b
      Additional Information 4: 0b4b0ba1592ebbc56adc05832bb92aa6
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=190175
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt
    The server is running all Microsoft updates. Rebooting doesn't help. I've checked the event logs and I don't see anything relevant.
    Help!
    Thanks
    Brad

    Hi,
    I would like to suggest you first run get-windowsfeature command on the core locally not remotely. And if it works, then try to remote run it.
     Invoke-Command -ComputerName CORE1 {get-WindowsFeature }
    Regards,
    Yan Li
    Cataleya Li
    TechNet Community Support

  • Window Features , how to use it?

    Hi!:
    At Property Editor of a portal page I can see "Window Features" but I can't find documentation on what put in it or how to use it.
    Can I put some argument to change the color of the page? (and only this particular page) something like "BGCOLOR" at html.
    Thanks a lot.
    RLS

    I find it!.
    Window Features: Specifies the appearance of the new window launched by an iView whose 'Launch in New Window' property is set to '1'. Enter a comma-separated list of Javascript parameter; for example: 'fullscreen=yes,toolbar=yes'. If empty, the new window apens according to default JavaScrit parameters

  • Windows feature page blank

    Hi everyone. I got a envy h8-1513c running on windows 8 64-bit. I went on my windows feature page and I mistakenly unchecked all the features. At this time, no applications or programs were working. I paniqued and I went back to the windows features page and I checked all the features...Unfortunately, it did not solve the issue: I was still not able to run the windows updates and to open files, apps or programs.  I ran the BIOS update and when the system restarted to configure the update, the automatic repair started itself. The nb restarted and everything is working fine. Now I'm able to run windows update, open files, apps and programs. However, when I go to the windows features page, it's just blank. . .what can I do to fill it out again. . . does it really matter if it's blank, I mean the nb is working fine so maybe it's not that bad...please help me for this. I have a lot of questions in my mind :-(

    Hello thebrave007
    I can appreciate your concerns with Windows 8 and I am linking you a document that should resolve your initial query and possibly answer your other questions as well. The document I am linking below is 'Learning How to Use Windows 8 Features and Apps' there are a large number of links in this document to different topics that you possibly have questions about.
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c03325557
    If you have any further questions for concerns please feel free to re-post.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

  • Solved : Turn Windows features on or off is blank or empty while opening

    Successfully solved : Turn windows features on or off blank fix 
    If you are going to enable or disable or installing any feature in windows 7, you have to do the setup through “Turn Windows features on or off” in
    Programs and Features.
    When you click on it, Windows Features dialog will appear asking you to “Please wait” and it will start searching for a list of windows features such
    as games, indexing service, internet information services (IIS) and etc that you can turn on or off. Windows Features is actually pretty much the same as Add/Remove Windows Component in Windows XP. You can also run Windows Features by typing optionalfeatures.exe
    at run or command prompt.
    ISSUE:
    In Windows 7 while going to enable “ Turn Windows features on or off “ in programs and features left side option the dialog it will be came out empty
    or blank.
    Normally you can able to see “please wait” initially after it tries to list out all the features, but if the machine having issue then it totally shows blank.
    For this issue Microsoft has created a knowledge base 931712 to acknowledge the problem and also provided 2 solutions to resolve this issue. but this solution is didn't work & it will not rectify this issue.
    SOLUTION:
    Download System Update Readiness Tool from Microsoft and install the machine. Please select OS compatible package(OS & supporting bit
    version) and download the file.
    Article page: http://support.microsoft.com/kb/947821?wa=wsignin1.0
    Download Link : http://www.microsoft.com/en-us/download/details.aspx?id=3132
    Tool Name: 
    System Update Readiness Tool for Windows 7 (KB947821) [November 2012] - Windows6.1-KB947821-v25-x86.msu
    (System Update Readiness Tool fixes Windows Update errors in Windows 8, Windows 7, Windows Vista, Windows Server 2008 R2, and
    Windows Server 2008)
    once successfully installed then you can go to >control panel >programs and features > and click the left side option “ Turn Windows features
    on or off” and check.
    If it’s not again listed please restart the machine then check.
    After it will work fine.
    This is what I faced and fixed this issue after long way through Google help.
    If this post was helpful to you please login this site and vote for me.
    Thanks & Regards,
    D. Jagadish

    Dear All,
    Thank you very much given good suggestion to me, I'm traded to follow above given steps but not yet resolve. Please help.
    Download and installed your given
    Windows6.1-KB947821-v33-x86
    patch file
    Still it’s showing white page while trying to click on
    Turn windows features on or off.
    Thanks & Regards
    Veerababu

  • Windows 7 shake-window feature in openbox?

    Is there a way to implement the windows 7 shake-window (minimize all except shaken window) feature in openbox?

    awayand wrote:minimize all except shaken window
    seems pretty clear to me? At any rate, the things you can make Openbox do are all laid out in the big list of 'Actions' (http://openbox.org/wiki/Help:Actions#ToggleShowDesktop) - ToggleShowDesktop coming closest to what you're describing (basically, it's minimize all and shift focus to desktop). No obvious way to make exceptions, though. 
    As for _how_ you do it, there's the Bindings list. I dont use much mouse in OB, so you'll have to find it yourself.

  • Not able to install the windows backup utility or any windows features

    Hi Guys,
    Good Day.
    while i'm trying to install any windows features in server (Windows 2008 Enterprise + service pack 2) I'm getting below error always. Thanks for the advanced help.
    Windows PowerShell
    Windows Server Backup Features
    Windows Server Backup
    Command-line Tools
    Windows PowerShell: Installation failed
    <Error>: Attempt to install Windows PowerShell failed with error code 0x8007045D. The request could not be performed because of an I/O device error
    Windows Server Backup Features: Installation failed
    <Error>: Attempt to install Windows Server Backup failed with error code 0x8007045D. The request could not be performed because of an I/O device error
    <Error>: Attempt to install Command-line Tools failed with error code 0x8007045D. The request could not be performed because of an I/O device error
    The following features were not installed:
    Windows Server Backup
    Command-line Tools

    Hello,
    This forum is for discussions and questions regarding profiles and Microsoft's recognition system on the MSDN and TechNet sites. It is not for products/technologies.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Bug in windows installer

    The windows installer for jmf seems to overwrite the CLASSPATH instead of appending, which you would expect.
    /Esben

    "wpqs" wrote
    There seems to be a bug in Windows 7 when setting the Environment Path Variable from Control Panel - System - Advanced System Settings - System Variables - select Path - click Edit - opens The Edit System Variable dialog box
    The Edit System Variable dialog box displayed the same collection of path strings (each terminated by ';') as I get when I opened a command prompt window and type 'path'. However, it was not possible to add a new path string (c:\wills\bin;) after the last
    string. I presumed that the collection of path strings was too long so I removed a few of the path strings. Unfortunately, I still couldn't type my new path string.
    BUG1: I would appear that length validation for text control in the Edit System Variable dialog box is not set to the same length as the max length for the collection of path strings.
    BUG2: I was eventually able to enter my new path string after deleting some more path strings, but I hit further problems after saving my new path variable (press OK) as it seemed to delete some path strings at the start of the collection. For example %SystemRoot%\system32.
    Therefore, I was unable to reopen the dialog box from Control Panel.
    https://msmvps.com/blogs/erikr/archive/2007/09/17/maximum-length-of-environment-variables-windows.aspx
    may help :)
    Noel Paton | Nil Carborundum Illegitemi |
    CrashFixPC | The Three-toed Sloth

  • Acrobat Pro XI frequent crashes when using New Window feature

    As a lawyer using Acrobat Pro XI to review legal documents, I find the New Window feature invaluable since it lets me view different parts of the same document at the same time.  However, when I use this feature I encounter frequent crashes, more often if I insert a comment in one of the windows.  Inserting those comments are very important to me.  Is there any way to avoid the crashes while using the New Window and Comment features together?

    Moved to https://forums.adobe.com/community/acrobat/creating__editing_%26_exporting_pdfs

  • File sharing bug with windows in mountain lion

    File Sharing Bug with Windows
    Hi,
    there are some windows in our firm and we're sharing the files using File Sharing. The problem is that the windowses can see the files not only the ones in public folder, but also whole disk, like Desktop, Library etc. When i installed Lion, it was happened again for one time. But then it fixed in a way which i don't know. After Mountain Lion, this problem occurs again.
    So, why can it be happened and how do i fix it? please help me.
    thank you.
    tanyildiz

    not any guess?

  • Cannot use Snagit 8's scrolling window feature with Firefox anymore.

    Snagit 8 is a screen capture program. It has a scrolling window feature that captures the whole web page. After the last FF update it no longer functions. It only captures what is viewed on the screen and no longer scrolls down to capture the whole page. I can still do this in IE (blah).
    == The last update

    same problem for me but no solution. IE8 ok.

  • Skype Performance Bug under Windows 8 x64 / endles...

    Dear Developers,
    please get rid of an annoying bug under Windows 8 x64 - this bug exists since several versions and still not fixed.
    Summary:
    After a while - maybe associated with energy saving options - a thread in Skype is getting more and more CPU time, causes by a thread always starts with ntdll!RtlGetCurrentPeb+0xf (see att.) <- what does this thread actually?
    Results:
    Heavy CPU usage, slowly Skype response - missing Messages. Only Skype restarts helps.
    I will do more investigation if needed. Let me know.
    Update:
    The thread uninterruptedly reads from
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\*
    Appears to a not catched endless loop?
    Attachments:
    2.PNG ‏19 KB
    3.PNG ‏89 KB

    rsbrux wrote:
    My Thinkpad originally came with Windows 7 Pro, but I have changed to Windows 8 in order to resolve problems with VSS.  OOB, both Windows 7 and Windows 8 gave me a "Desktop graphics performance" rating of 5.7.  Under Windows 7, upgrading to the latest Lenovo driver improved this to 6.1, leaving my HDD (at 5.9) as the limiting factor in performance.  Under Windows 8, however, replacing the Windows driver with the latest Lenovo driver has reduced "Desktop graphics performance" to 5.6!  What gives?
    P.S. I just discovered a Power Options advanced power setting "Intel Graphics Power Plan", which was set to "Maximum Battery Life" for both battery and plugged in.  I changed it to "Maximum Performance" when plugged in, but the Windows experience Index (WEI) for "Desktop graphics performance" remains a mer 5.8.
    After you changed the setting to "Maximum Performance" , did you run the WEI test again?

Maybe you are looking for