ms sec fix caused SocketException: An attempt was made to access a socket in a way forbidden by its

L

Les Caudle

I've got code that's been working for years.

This is running on Win2003 Server whiled logged in as the admin.

When the MS sec fixes were installed last night, this code now fails with:

System.Net.Sockets.SocketException: An attempt was made to access a socket in a
way forbidden by its access permissions

IDictionary props = new Hashtable();
props["name"] = "tcp";
props["port"] = 1234;
props["rejectRemoteRequests"] = "true";
props["bindTo"]= "127.0.0.1";

BinaryServerFormatterSinkProvider srv = new BinaryServerFormatterSinkProvider();

TcpServerChannel chnl = new TcpServerChannel(props,srv);

ChannelServices.RegisterChannel(chnl, false); // fails at this point


How can I resolve this?
 
L

Les Caudle

Actually, it fails on the TcpServerChannel chnl = new
TcpServerChannel(props,srv); - and only on Win2003 Server.

As the user has admin priv, I don't see how it can fail to have proper
permissions.

Anyone have a clue - I'm dead in the water until I resolve this?

Thanks, Les Caudle
 
S

Steven Cheng

Hi Les,

From your description, the remoting application used to work but stop
working after installed some windows security updates on the machine,
correct?

As you mentioned that it is the TCP server channel that cause the problem.
I think it maybe caused by the remoting runtime failed to start listening
on the port you specified. Have you enabled windows firewall on the server
machine, maybe the sec patch has reset the port setting. If this is the
case, you can try add the port as exception. Also, you can check whether
there is other firewall software that may block the listening port. BTW,
for general test, you can also try running a normal socket program which
listen on the certain tcp port to see whether it works.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: Les Caudle <[email protected]>
Subject: Re: ms sec fix caused SocketException: An attempt was made to
access a socket in a way forbidden by its access permissions
Date: Thu, 13 Mar 2008 12:40:57 -0500
Actually, it fails on the TcpServerChannel chnl = new
TcpServerChannel(props,srv); - and only on Win2003 Server.

As the user has admin priv, I don't see how it can fail to have proper
permissions.

Anyone have a clue - I'm dead in the water until I resolve this?

Thanks, Les Caudle

I've got code that's been working for years.

This is running on Win2003 Server whiled logged in as the admin.

When the MS sec fixes were installed last night, this code now fails with:

System.Net.Sockets.SocketException: An attempt was made to access a socket in a
way forbidden by its access permissions

IDictionary props = new Hashtable();
props["name"] = "tcp";
props["port"] = 1234;
props["rejectRemoteRequests"] = "true";
props["bindTo"]= "127.0.0.1";

BinaryServerFormatterSinkProvider srv = new BinaryServerFormatterSinkProvider();

TcpServerChannel chnl = new TcpServerChannel(props,srv);

ChannelServices.RegisterChannel(chnl, false); // fails at this point


How can I resolve this?
 
A

Alberto Poblacion

I use Vista and Vs 2008 [...]
I turn off the firewall,antivirus and i,m the administartor but the
still!!!!!!!!!!!!!

No, if you are on Vista you are not Administrator, because UAC lowers
your permissions to those of an ordinary user.

You can start Visual Studio by right-clicking on its icon and selecting
"Run as Administrator". That should do the trick.
If you want a more permanent solution, add a Manifest to the project
with the "RequireAdministrator" parameter.
 
B

Bert Hyman

In "Alberto Poblacion"
in message
I use Vista and Vs 2008 [...]
I turn off the firewall,antivirus and i,m the administartor but the
still!!!!!!!!!!!!!

No, if you are on Vista you are not Administrator, because UAC
lowers your permissions to those of an ordinary user.

A policy certainly put in place by Mordac, the Preventer of Information
Services.

Security is more important than usability.

http://dilbert.com/strips/comic/2007-11-16/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top