10013 error (AccessDenied) on Silverlight Socet application - c#

I am writing silverlight 3 application which is working on network.
It works like client-server application. There is WinForm application for server and silverlight application for client.
I use TcpListener on server and connect from client to it with Socket.
In local network it works fine, but when I try to use it from internet it don't connect to server.
I use IP address on local network and real IP with port number for internet version.
I get error 10013 AccessDenied.
Port number is correct and access policy exist.
Firewall is turned of.
Where is the problem?
Thanks.

Have you tried to check the general availability of the connection from your machine to the Internet server with telnet ?

The problem was that computer, where hosted website hasn't real IP address, and I couldn't connect to it from internet. I added Real IP address and everything works fine now.

Related

Hosting a C# Remoting Application

i have created an Chat Application in C# using TCPChannel and Remoting Service. My Application have 3 parts one is remoteobject, second is RemoteServer and third one is ClientSide. Everything is Working fine in my pc, mean if i run server application and client application in same server its works very good, because localhost. but when i try to host my server application in my VPS and client application in my pc then i can not connect with my server application. how can i specifies an Static IP to my Server Application so i can access my app from anywhere. please help
You may want to check out your firewall settings. You will need to open a port to allow outside traffic to access the particular port on your machine.
this constructor is using a fixed port: https://msdn.microsoft.com/en-us/library/cdb9dcxt(v=vs.110).aspx

Client can connect to Server on same machine using localhost, but not when IP Address or hostname is used

I'm using VS Express 2012, setting up a simple server and client on a Windows Server 2008R2 machine with all of the latest updates installed. When I have the client try to connect to the running server using "localhost" as the host to connect to, everything works fine. When I have the client try to connect to the running server using the IP address or the actual host name, I see the "No connection could be made because the target machine actively refused it 192.168.5.159:13000 ..." error message. netstat shows my server is listening on the same port as reported in the error message (13000). I've modified the Windows Firewall setting to allow my client and server to communicate through the Windows Firewall. I've added an entry to my Hosts file associating my host name with the IP address. Any suggestions as to what else I can try? All of this is being done on a private (work) network.
Usually when you set up a server, you need to specify the hostname or IP the server listens on. When you initialize a server to use localhost, you can only use localhost to connect to it.
If you want a server to accept requests from every source you need to see if you can use a wildcard to accept all connections. For example 0.0.0.0 is used a lot.

connect localhost from another machine

Is there anyway i can navigate to a website i develop on my computer from a smartphone connected to the same network?
the site is running on localhost, can I make a bridge or something like that?
thanks.
I think you can if you use you're IP directly as the website's name.For example in TOMCAT all the sites are localhost:port/Project_name/filename.html
So if you would use "http://your_ip:port/Project_name/filename.html", it should work.
As a note, the firewall may stop this from working.
As long as your site is available to the network, just use the name of your PC.
So if you were developing on http://localhost:12345 connect using http://muzE-PC:12345 (assuming muzE-PC was the name of your computer)
instead of localhost use, ip address.
Make sure that website is not blocked by windows firewall.
ipconfig can be used to determine ip address.
On remote system, localhost will refer to that remote system (not the system on which web site is running).

c# socket server - deploying, starting, stopping

I'm a little confused when it comes to socket servers in terms of deploying it online.
Running locally is fine as most tutorials get you to make a server application and a client application which I can execute. Done all that for awhile now and I'm happy with it but now I want to try it using a web host.
How would I deploy the socket server to my web host and then run the server? do I just upload the program to the server and run www.mywebpage.com/mysocketserver (assuming the program is called mysocketserver.exe)
may sound like a stupid question but I'm having one of those brain dead moments.
[Edit]
Great answers guys thank you. Shame I can only mark one as the answer.
Most hosting services are website related: you upload your website to their server and the host takes care of provisioning the application.
However you haven't written a website that is served by a web server, but a socket server, which is more akin to the web server itself that runs a website.
As a result you will need a host that will allow you to install and run applications, such as a Virtual Private Server service, rent a physical server or use a cloud service such as Amazon EC2.
You usually Remote Desktop or SSH into the server you are renting (or own) to upload and start the application either as a normal application, a Service or a Daemon.
Once you have installed your socket server on the host server and started the application running you should be able to contact your service using the IP address for your server and the port that you are running your socket server on.
For example, if your ip address is 10.0.0.1 and you've written your socket server to listen on port 1234, you should be able to contact your service at address 10.0.0.1:1234.
Take into account firewalls allowing access to that port.
You will also then be able to use a DNS service such as DynDns to assign a domain name to that ip address.
You can't do that unless your socket server is using HTTP as a protocol.
You are using a port for your server, right? The ports are used to identify which application to talk with.
When you browse the web using "http://something" you really say let me get the stuff which can be found on the IP 1.2.3.4 (DNS lookup) using port 80 (which is registered for HTTP). You don't have to specify the port in the browser since all browsers know that HTTP uses port 80.
So what you are really should do is to put the socket server on your host and tell your customers/users that they can connect to your socket server at port XXX on host "www.mywebpage.com".
If you've built a client you'll just hard code the port in it or specify the default port automatically.
The problem in the Internet is the routing/name translation, so that mywebpage gets translated into the correct IP address.
Either your webserver needs a fixed public IP address or you need to use a service like dynds which will dynamically map your changing IP address to the static name.

Unable to connect to local machine IP address using internet IP address

I've spent the last month writing a multiplayer game. I have only been testing it on one machine, using 127.0.01:9051 as the IPEndPoint.
I changed the IP address to my WAN IP, configured port forwarding on my router, configured my software firewall etc... But, it doesn't connect.
I have checked if the port is open using this site. Result: the port is really open.
Also, when I check the port from that website, my server receives packets just fine; however, when I connect from my own machine... it doesn't receive anything.
I've broken everything down to the basics to make sure it wasn't a problem with my code.
This basic code does not work:
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("XXX.XXX.XXX.XXX"), 9051);
TcpClient client = new TcpClient();
client.Connect(iep);
Any ideas are much appreciated.
If you are attempting to connect to the IP that is Forwarded (outsideIP) to the same machine (insideIP), it won't work. There are very few enterprise firewalls and no consumer devices (I know of) that will route a packet from the inside out and translate it back in.
[Internet] -- outsideIP[Router/Firewall]insideIP1 -- insideIP2[Computer]
In this case, packets from insideIP(X) will not be able to connect to outsideIP.
Try to see if you can telnet to your wan IP on port 9051. Routers don't really like it when you connect to their wan IP from within the network itself.
You could use Dyndns or some other service for the outside world to connect to your server and put the same name into your host file that resolves to 127.0.0.1 so that you can connect internally.
Is your client and your server (both the same machine in your failing test) using the same endpoint ip/port? You can only bind a port once at a time. Try using two ports one for server in one for server out (clinet in). That way they will not clash. Use Telnet to check you can connect to the IP/Ports you are using and Netstat to check they are not in use already.

Categories

Resources