Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to create a C# application that listens to a Local port/socket, filters a client submitted URI string, respond, as well as run some server side code, using something very similar to this API... http://www.vmix.com.au/help12/index.htm?DeveloperAPI.html

Example URI: http://127.0.0.1:8088/api/?Function=Fade&Duration=1000

I want to be able to capture the URI sent to this server, and parse the information within it, then act upon the results with server side code, and respond to the requesting client with success or failure.

Could someone please point me in the proper direction to start learning this process?

I don't expect it to be easy, but searching for this information isn't either, as I'm not sure I'm searching the correct keywords.

Although this request is for C#, C++ would also be acceptable.

Thanks for any assistance you can provide.
Posted
Comments
ZurdoDev 18-Jun-14 11:07am    
Where exactly are you stuck? Can you just create a web service?
Jumpin' Jeff 18-Jun-14 11:25am    
I guess the proper search keywords would be a start.
I am willing to do the search, but uncertain what to search for to get started.

Being built in, I would think I am looking for a web service, instead of a web server?

I've done searches on HTTP protocol, Server side programming, Web service, and web server.

Are there better keywords to search on that better describe what I want to do?

Most of what I find, is designed to respond with html, but I need to simply grab the URI sent (as in the example provided) to the server, and parse it, react via programming, and respond success or failure.

1 solution

Do you have any constraints on the platform (e.g. embedded devices etc.) or will this just be plain old desktop or server software? If size doesn't matter you could just use a tomcat instance or maybe an apache webserver you can integrate in your product. If the scripting should be possible with .NET and ASP.NET you might want to consider Cassini[^].

Cheers!
 
Share this answer
 
v2
Comments
Jumpin' Jeff 18-Jun-14 13:47pm    
I do have constraints! it must be built in, just as it is in the vMix example provided, for simplicity for the end user. They should not be troubled with setting up a more complex external server. Just like the vMix example, it will be installed on a users desktop, or laptop computer, and listen to a port. When a request is made by a client, the URI string will need to be parsed, and reacted upon. I've been able to listen to a port using AutoHotKey, and respond with a message to the client, but I am not able to determine how to extract the Requested URL from the request message. I need to be able to read it in something other than Chinese to be able to parse it. That is what I should be requesting. Assistance converting the request message to readable form, for parsing.
Manfred Rudolf Bihy 18-Jun-14 14:21pm    
You did not understand what I was trying to tell you. The web server will be integrated into your software and installed/setup when your application is being installed. Have a look at Cassini for instance, there are more than enough samples out there on how to integrate or "embed" a webserver into your application.
Jumpin' Jeff 18-Jun-14 14:44pm    
My Bad, I shall look, Thanks!
Jumpin' Jeff 18-Jun-14 16:23pm    
Had a very quick look at Cassini, and perhaps I'm overlooking something, but I don't want or need a physical or virtual path. Not done looking by any means, I'll dig deep to see if it is capable of being used as an API server.
Jumpin' Jeff 20-Jun-14 13:14pm    
I think I have found what I need to use to accomplish my task.
The proper search term in Google is "self host asp.net web api".

Here is one of the many links I found using this search... http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api

Thanks for your assistance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900