Is there any way to code my own console client for hyper-v guest machines ?
I don't want to connect to guest using RDP. I would like to do it in same way Microsoft is doing it.
What I've found so far is (correct me if I am wrong):
Their client connects to the host on port 2179. Then some handshaking, metadata exchange happens on port 2179 and client gets data on some 49xxx port.
What I don't understand is what happens on port 2179 ? Is there any protocol specification I should look for ?
Thanks
A little bit of Googling on Hyper-V and 2179 led me to vmconnect.exe, a program used to connect to virtual machines running on Hyper-V servers.
This tool is stated to use the Remote Desktop Protocol.
So I guess you can connect using the RDP API itself (mstscax.dll), the Cassia library (as suggested in this answer) or the ActiveX control AxMSTSCLib.
Related
I’m developing an app that connects on port 9050 through the public ip of my server. It works fine on lan but if I’m connected on a different network it fails what can I do to fix this?
first try from Command Prompt this command: telnet ip 9050
if it working means the port 9050 between your pc and the server already opened , otherwise you should check why and where the port is blocked (may be firewall in this case you need to create rule in firewall to pass ).
I don't have any code to go by and I know nothing about your network configuration, but I'll tell you what I generally do when debugging a network-enabled app. First, look at your firewall rules. This will obviously vary depending on what OS you're using but on Windows 10 application-specific permissions are located in Control Panel > System and Security > Windows Defender Firewall > Advanced Settings.
After making sure your app can get through your devices' firewall, check the router settings next. Your packets may not getting by whatever inbuilt security protocols are in place. Since your program works with LAN but not over the Internet, this is a distinct possibility. Also, depending on your network configuration, port forwarding may be necessary; if you're sending data via a public IP address, the router needs some way to know which device on the local network needs to be receiving it. Additionally, if you're trying to connect to your server from the same network you're hosting it on, make sure you use the IP loopback address, which I believe is always 127.0.0.1, or in C# IPAddress.Loopback. Public addresses often won't work when connecting to a local host.
If you're still having problems, I recommend using Wireshark. It's an advanced diagnostics tool that tells you exactly what is being sent and received over your network, and can help pinpoint otherwise hard to spot issues.
i need to run a wcf service in our office server and want to access that service from out side of office. i test the wcf service in LAN and it is working fine. our office has static ip. some one told me that port forwarding is required to access that wcf service from out side of office. i have no access to our office routine and that is why i can enter into router & can not forward any port from there. so i have decided i have to do port forwarding programmatically by c#. so looking for guidance which library i can use to do port forwarding using c#.
if i do not know the router login then a c# program can enable port forwarding ? i like to also know what port forwarding does ? does it save any data in router or any pc?
guide me in details how can i enable port forwarding for my wcf service if i do not have access office router and want to enable the access of wcf service running in a office pc from out side ? looking for great discussion. thanks
updated
i have found one link http://pietschsoft.com/post/2009/02/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx
it is using com comonet for port forwarding. i have confusion about the picture they have shown. please have a look and tell me. here is the pic.
according to the pic we need to mention external ip, external port and internal ip & port.
if my wcf service is running on port 7756 then do i need to specify the same port for external & internal port?
what ip i need to specify as external & internal IP?
if machine ip is 192.168.6.2 where my wcf service is running locally and if our office static ip is 122.160.187.236 then how i need to specify ip's for external & internal purpose? please help me with information. thanks
http://www.fluxbytes.com/csharp/upnp-port-forwarding-the-easy-way/
It is targeted at Mono but Mono is a compliant CLR and BCL, so it will work on the standard Windows .Net too.
Word of warning: I have not tested that library nor the guide myself.
Port Forwarding tells the router to do something along the lines of: "Whatever traffic comes in via port X is mine, send it to my IP".
More info: https://en.wikipedia.org/wiki/Port_forwarding
i'm writing a server side application and a windows service which need to be installed on a remote host
the service returns CPU usage to the serverside application - this is NOT the problem
the serverside application deploys the service on the remote host. - also, not the problem
THE PROBLEM:
but how do i setup a socket connection between the two, when i dont want to hardcode the ip address? (for scalability) - do i need to use multicast or is there some devious way of doing this? is there another solution than using sockets? -
i'm new to writing Windows Services.
I need help figuring out how to communicate between the server and the service without hardcoding IP-addr.
thank you in advance.
MY SOLUTION:
I created a windows service, that reads a xml file with the IP and port of the Server application. so when i deploy my client application, i also create a xml file with the network information.
Regards Alex
A lot of communication platforms now use network discovery; there's an article on codeproject that goes into detail about using network discovery.
The problem was, I did not know what machine name the server was running on, in fact I wanted this to be flexible, and selectable by the user.
Seems relevant to http://www.codeproject.com/Articles/16113/Retreiving-a-list-of-network-computer-names-using
Have you thought of using WCF?
http://msdn.microsoft.com/en-us/library/ms731082.aspx
Regarding multicast, you can have a WCF server multicast announce it's availability on a network; see http://msdn.microsoft.com/en-us/library/dd456782.aspx
another solution could be to create the service as a console application with arguments (endpoint ip address) and then just deploy it with the arguments on the remote host
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.
We have a server application (developed using .Net 1.1, C#) which listen the port 8086 and the client application, before starting will handshake with this server using remoting.
The application is working fine in almost all environments - Windows 2000/2003/2008/XP/Vista.
Now we are facing an issue with Windows 7.
When we are staring the server, it’s opening the port and will be listening to clients, but when try to send a request from a client who is running in other OS, it gives a message that server is not running.
We disabled the proxy, gave the exceptions for proxy but all went in vain. On further analysis we found that the system is having multiple connectivity (LAN, Bluetooth &WIFI).
When we checked the TCP port using netstat –a it showed the Local Address as 0.0.0.0:8086. So we disabled/removed the Bluetooth & WiFi option and tried again then also netstat is showing LocalAddress 0.0.0.0:8086.
How to go ahead in this situation?
Thanks in advance.
Do a network capture using Microsoft Network Monitor or Wireshark to better understand the underlying TCP/IP packets. That can show what's up easily.