Using a hub on port 80 for signal r - web-services

I at the moment I am polling a web service from my c# desktop winform app to retrieve messages as and when they come in. Instead of polling I thought maybe it would be better to receive a 'push' notification? this lead me to the SignalR framework. As I understand you have to create a hub on the server. But, can i use port 80 or will I get an error stating that the port is is use by iis? If so, is there an alternative to what I can do?
thanks

Two processes can not bind to the same port. If you have IIS running on port 80, you'll have to either proxy the other software through IIS or run it on a different port.

Related

Java combining sockets with web services

I have an older statusing application that uses DataGramSockets to send/rec status messages from a number of programs. I want to convert this reporting app to use web services so it can also be queried from web pages.
Is it possible to have both the socket listening on its usual port while another service, second thread, listen to an http port for web connections?
You can easily use Java socket.io Library (for example) to use websocket/websocket secure over http/https.
So I will be using web sockets at this point. I see there really is no perfect answer to this question and its a little open ended. Ill get it closed.

port number in URL

we currently have a web service hosted on our server and the link to the service is something like this: www.something.com:8041/MyService.asmx
our client cant open that link in their browser or connect to the service through the app. They found out that port 8041 is blocked.... this doesnt make sense to me, that port number is in the URL why would blocking ports have anything to do with that? its not looking the request is going out through port 8041?
We are going to unblock port 8041 at the client but that doesnt make sense, the port 8041 is for our servers benefit and has been unblocked...
No, actually going to http://www.something.com:8041/MyService does in fact go through port 8041, and if you have a group of clients sitting behind one firewall (e.g. business 1) trying to access a server behind a second firewall (e.g. business 2), you need to make sure both firewalls are setup to allow this.
If you don't want to have to go around opening ports, a common solution is to configure a webserver (nginx, varnish, etc.) that is listening on port 80 (or 443) that reverse proxies to whatever service is listening on the non-standard port.

c++ how to listen HTTP requests

Im new in C++.
I need to listen HTTP requests.
Please advice me some good tutorials or examples
Thanks
update:
Platform: Windows
Language: C++
I will explain more clearly what i need
when user clicks row on this page: http://ucp-anticheat.org/monitor.html applications is automatically starts on client machine.
I want to make same thing.
I think on client side is service which listens http requests and if url starts with steam:// service automatically runs application...
Do i need to listen http requests?
What is best solution for my problem?
You can listen to http requests through a web server like mongoose , which can be easily used in C++ http://code.google.com/p/mongoose/ , and here is a good example of using mongoose web server http://code.google.com/p/mongoose/source/browse/examples/hello.c
I m not sure what you mean 'client side', if you are meaning Browser as your client, you can't control nothing outside your browser. If you want to control a machine, you need your client machine to run your exe, that has the code to act based on your server instructions.
You should create a simple server program, create a SOCKET listening on default http, https etc, ports. Usually we do it inside a loop (at each one you make a read).
Now... would be easer if you specified if you are on Unix like OS or Windows, but from now on you can google it. Like sys/socket.h or try "man 7 socket" on almost all linux (at least the ones I know).
If you want to sniff something you can google some specific apps around web.
If i get your question right, you want to be able to launch an application when someone clicks a link with a custom protocol, like steam:// or telnet://. You are looking for an Protocol Handler.
A simple way to register such an application is using the ftype program, as described here.

WebService timeout

I have a problem with deploying my web service in our Web server. In my
development machine (inside of our LAN), everything works fine. When I move
the application into our Web server (public addressed), I always get the
timeout exception. while i connecting the web service through my web browser it works fine with no issues, but through application am getting the timeout error. My app connects to our database server (inside of our LAN) to get statistical data in form of datasets. can i know the issue about this point.
That is most likely a firewall/port forwarding issue.
Did I understand you correctly: Your client application connects to the database server directly?
You should check which port you are using to connect to the database server.
Then check if the web server has an active firewall and if so, configure it properly to accept connections on that port.
You can always easily check if a port is open and reachable by using telnet:
On the command line type telnet MY_IP MY_PORT.
If a connection can be established the port is open.

Testing a remote web service with soapUI

I have a Javax web service deployed in a remote Linux machine within a JBoss ESB container. I am able to test the web service using soapUI on the same machine as where the service is deployed. The WDSL URI I used was something like http://127.0.0.1:8080/abcd/abcd?wsdl.
What I would like to do is to be able to test the same service from another machine using soapUI. I tried replacing 127.0.0.1 with the IP address of the machine where the service is deployed. This does not seem to work. Can someone tell me what I am missing here?
Thanks.
a sum of things could go wrong there - as already mentioned by the others the firewall is blocking access for the given (address, port) pair. Another thing that happened to me was that the WSDL was generated using the name of the machine it was deployed on and whenever I was trying to call the service from a different machine it was complaining that I cannot find the given machine.
You need to test network connectively. One tool you can use is plain old telnet. If you telnet to the ip/port combo of the web server, you will get a response (an HTTP error). For example:
$ telnet 192.168.0.10 8080
If you get nothing then there is almost certainly a firewall blocking access.
If you are convinced that no firewall is blocking you, the other possibility is that the web server is only bound to the local network adapter (127.0.0.1) and not the other network adapters (ethernet/wifi). This is very unlikely however.