Thursday, July 24, 2014

Tech | HowTo Resolve: Only one usage of each socket address (protocol/network address/port) is normally permitted

This error occurs when an operating system fails to open a port to communicate to the domain for the service permissions check. This is generally a transitory error and is unrelated to the service.

You may be able to wait for five minutes, and then restart the service successfully.

If the error persists, it can usually be resolved in Windows by setting the registry keys in the articles below. The referenced keys do not exist by default in the registry, so you have to make them to change the system settings from their default.

Another possible reason is that you are overloading the TCP/IP stack. Windows (and I think all socket stacks actually) have a limitation on the number of sockets that can be opened in rapid sequence due to how sockets get closed under normal operation. Whenever a socket is closed, it enters the TIME_WAIT state for a certain time (240 seconds IIRC).

Each time you poll, a socket is consumed out of the default dynamic range (I think it’s about 5000 dynamic ports just above 1024), and each time that poll ends, that particular socket goes into TIME_WAIT. If you poll frequently enough, you will eventually consume all of the available ports, which will result in TCP error 10048.

Generally, WCF tries to avoid this problem by pooling connections and things like that. This is usually the case with internal services that are not going over the internet. I am not sure if any of the wsHttp bindings support connection pooling, but the netTcp binding should. I would assume named pipes does not run into this problem. I couldn't say for the MSMQ binding.

There are two solutions you can use to get around this problem. You can either increase the dynamic port range, or reduce the period of TIME_WAIT. The former is probably the safer route, but if you are consuming an extremely high volume of sockets (which doesn't sound like the case for your scenario), reducing TIME_WAIT is a better option (or both together.)

Changing the Dynamic Port Range
  1. Open regedit.
  2. Open key HKLM\System\CurrentControlSet\Services\Tcpip\Parameters
  3. Edit (or create as DWORD) the MaxUserPort value.
  4. Set it to a higher number. (i.e. 65534)

Changing the TIME_WAIT delay
  1. Open regedit.
  2. Open key HKLM\System\CurrentControlSet\Services\Tcpip\Parameters
  3. Edit (or create as DWORD) the TCPTimeWaitDelay.
  4. Set it to a lower number. Value is in seconds. (i.e. 60 for 1 minute delay)

One of the above solutions should fix your problem. If it persists after changing the port range, I would see try increasing the period of your polling so it happens less frequently. That will give you more leeway to work around the time wait delay. I would change the time wait delay as a last resort.

About TcpTimedWaitDelay
21 out of 24 rated this helpful - Rate this topic

Data type
Default value
0x1E 0x12C ( 30–300 seconds )
0xF0 ( 240 seconds = 4 minutes )

Determines the time that must elapse before TCP can release a closed connection and reuse its resources. This interval between closure and release is known as the TIME_WAIT state or 2MSL state. During this time, the connection can be reopened at much less cost to the client and server than establishing a new connection.

RFC 793 requires that TCP maintains a closed connection for an interval at least equal to twice the maximum segment lifetime (2MSL) of the network. When a connection is released, its socket pair and TCP control block (TCB) can be used to support another connection.

By default, the MSL is defined to be 120 seconds, and the value of this entry is equal to two MSLs, or 4 minutes. However, you can use this entry to customize the interval.

Reducing the value of this entry allows TCP to release closed connections faster, providing more resources for new connections. However, if the value is too low, TCP might release connection resources before the connection is complete, requiring the server to use additional resources to reestablish the connection.

Normally, TCP does not release closed connections until the value of this entry expires. However, TCP can release connections before this value expires if it is running out of TCP control blocks (TCBs). The number of TCBs the system creates is specified by the value of the MaxFreeTcbs entry.

Windows 2000 does not add this entry to the registry. You can add it by editing the registry or by using a program that edits the registry.

Dan A. 

Music | Nzele – Madilu System Lyrics!

Kolinga nalingaki yo Nzele, batémoin bazalaki te…

(When I loved you Nzele, there were no witnesses)

Namituni solo tokabwani, mikolo mibale nga nakamwa

(I ask myself if indeed we broke-up within two days… I am surprised)

Nasala nioso mpo nazua yo

(I am trying my best to woo you)

Zabola ye akokabola biso

(It is the devil's work to separate us)

Ameki mpe aleisa yo mbuma,

(He tried to feed you with the forbidden fruit-(decieve)

Nzele olandi mabe eva asala

(Nzele like Eve, You have repeated the same mistake she did (at the Garden of Eden)

Somo oh, somo oh

(This is frightening, ooh very upsetting indeed.)

Vertige esali nga nzele,

(An engulfed in some kind of giddiness/dizziness my dear)

Motema eziki makila ya nzoto esopani molimo ekomi kaina

(My heart is hurt, blood dripped and Cain's spirit has taken over)

Nalingi nayeba soki tolingana

(I would like to know if we are still in love)

Nalingi bayeba basusu basala zua

(Let's show them haters)

Nzele motema na ngai wa bolingo

(That Nzele you are my sweet-heart)

Ebongi o decider amour motindo wana, nzele eeh

(It will be much better if you loved this way, Nzele)

Batela mibeko nga nakopesa yo

(Follow the recommendations I give u)

Soki obebisi lelo bango baseka

(Failure to which they-haters- will laugh at us)

Nga madilu balinga ngai mingi na quartier

(I Madilu, I am the darling in the neigbourhood)

Ntina nini basalela nga na yo likita bozoba

(How comes they meet and Grapevine about us-Idiocy)

Ooh bozoba, Ooh bozoba,

(This is stupidity, Foolishness)

Mongali Iena ,Mongali Iena, mongali ….Iena

Mongali mi nakufa na mabaya

(Mongali look, I am dying coz of the wrong reasons)

Moto na moto bakutani

(Some people meet)

Bazali se kobenda bolingo na makanisi

(Just cause 'stress' in love relationships)

Ye ye ye ye ye eh nga nasila

(Oh am finished!)-

Tech | How to bypass Remote Keyboard language Settings

If you want the session to use the default keyboard layout stored in the user profile instead of the layout provided by the Terminal Server client after the user logs on to the Terminal Server computer, you can set the IgnoreRemoteKeyboardLayout registry value to 1.

After users first connect to the Terminal Server computer, configure the default keyboard layout and input language that you want, and then log off. All later user logons will use the default keyboard layout and input language from the profile.

To do so, please perform the following steps:  

·         On the terminal server, click Start, click Run, type regedit, and then click OK. 

·         Locate and then click the following registry subkey: 

o   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout 

·         On the Edit menu, click Add Value, and then add the following registry information:

o   Value name: IgnoreRemoteKeyboardLayout

o   Data type: REG_DWORD

o   Value data: 1

·         Quit Registry Editor. 

After you first connect to the Terminal Server computer, configure the default keyboard layout and input language that you want, and then log off. All later user logons will use the default keyboard layout and input language from the profile.