Hi,
I'm running a C++/CLI WCF self-hosted service and a Windows Store App client. It works when the service and client are running on the same computer. When I move the service to a remote computer in a Home Network (i.e. no Domain) I get the TCP error
10013 "An attempt was made to access a socket in a way forbidden by its access permissions".
On the remote (service) computer I have added the Windows features of:
.NET Framework 4.5 Advanced Services
WCF Services
TCP Activation
TCP Port Sharing
The following is the service initialization code:
void WcfPlaylistManagerConfig(String^ hostMachine, String^ port) { System::Type^ type = PlaylistManager::typeid; String^ uri("net.tcp://main:7008/PlaylistManager"); String^ uriMex("net.tcp://main:7008/PlaylistManager/mex"); ServiceHost^ host = gcnew ServiceHost(type); try { NetTcpBinding^ binding = gcnew NetTcpBinding(); binding->Security->Mode = SecurityMode::None; host->AddServiceEndpoint( type, binding, uri); Binding^ mexb = MetadataExchangeBindings::CreateMexTcpBinding(); ServiceMetadataBehavior^ mdb = gcnew ServiceMetadataBehavior(); host->Description->Behaviors->Add(mdb); host->AddServiceEndpoint( IMetadataExchange::typeid, mexb, uriMex); host->Open(); } catch(ConfigurationErrorsException^ ex) { System::Diagnostics::Debug::Print(ex->Message); } }
The abbreviated client code does this:
void Connect() { NetTcpBinding binding = new NetTcpBinding(SecurityMode.None); EndpointAddress addrPlaylistManager = new EndpointAddress(uriPlaylistManager); _playlistManager = new Fb2kPlaylistManager.PlaylistManagerClient(binding, addrPlaylistManager); }
Thanks.