Communicate With An HTTPLISTENER That I Have Created?
Dec 28, 2011I've got this code below that creates an HTTPLISTENER that is nicely waiting at listener.GetContext().[code]....
View 1 RepliesI've got this code below that creates an HTTPLISTENER that is nicely waiting at listener.GetContext().[code]....
View 1 RepliesI've got this code below that creates an HTTPLISTENER that is nicely waiting at listener.GetContext().How do I communicate with this from another VB app? I cannot seem to get WebRequest.Create to work with the URI that my HTTPLISTENER example is using. This line of code from a second app is not working:
Dim request As WebRequest = WebRequest.Create(prefixes(0))
Here is the code:
[Code]...
I wrote a HttpListener console application just to test it. I have been able to get the Httplistener class to respond to request for the local host, but not for any other URL. Any ideas? All examples I have seen on the Web just parrot what's on MSDN but no one has actually said that they got it work for any other URL other than local host.
In my code, I will add a URL to listen to like:Prefixes.Add("http://junk1234:80/"It it registers just fine(no errors) but when I type in http://junk1234:80 in my browser, my application just sits there and does not respond.
This works just fine(+ is a wild card to listen to any URL):Prefixes.Add("http://+:8080/") Browser URL: Http://localhost:8080 But if I change the URL to Http://junk3333:8080, my Listener code does not see it even though it should see any URL on port 8080.
I am running on Vista Home Premium(.Net 3.5) but running my listener console app as a admin.
what am I missing here.. I'm using the MSDN example but I want toread the xml that is coming as part of the XML..
Public Sub AsynchronousListener(ByVal prefixes() As String)
' spin up listener
listener = New HttpListener()
[code].....
I have an httpListener exe that is working great. What I need to do now is make it a service (I think) so that when the server is rebooted, this program will start automatically. I found a few tutorials for making services and I got one installed, but when I started it, it said it took to long to respond. I was thinking that might be because I have a while true loop going in the onStart method.
View 2 RepliesHow do i allow the HttpListener in vb2005.net to allow outside access?
For testing purposes i have set it up to use the same ports as my webserver uses so there are no firewall issues.
the prefixes are set up to take the localhost on port 80 the realm is unset AuthenticationSchemes = Net.AuthenticationSchemes.Anonymous
it works just fine locally on the machine, but cant be reached by web browser on any other machine on my network
When using ASP we can reference HttpContext.Current from anywhere in the code to get at the current http context.
I want to do something similar using HttpListener, so that I can access GET/POST data etc from anywhere in my code. Can I reference some global object for this, or do I need to explicitly pass the current HttpListenerContext object all through my code?
In vb2005 how do you simulate a web browser's file download using Net.HttpListener?This current program functions somewhat like a webserver. how when a client from a web browser
asks for a file do i allow them to down load the file? currently the method will tell the browser that there is a file but it will fail after the client oks the file for download.
I've created an httplistener and I'm using the async method it has.Starts like this on a BUTTON click in my test app
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim prefixes() As String = {"http://*:8080/HttpListener/"}
StartRequests(prefixes)
End Sub
[code]....
This forces the callback to fire - for some reason that I don't quite understand and it gets this error...
Quote:
The I/O operation has been aborted because of either a thread exit or an application request at this line
Private Sub GetContextCallBack(ByVal result As IAsyncResult)
'Dim listener As HttpListener = CType(result.AsyncState, HttpListener)
Dim context As HttpListenerContext = m_listener.EndGetContext(result)
I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1. BACKEND1 will be running on a SERVER when this gets ready for production use. Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.
On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files. Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on. Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK? Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?
My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much. just looking for opinions. I guess ultimately I'll have to bench mark this myself in a production environment to get a real answer.
I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1.BACKEND1 will be running on a SERVER when this gets ready for production use.Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.
On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files.Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on.Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK?
Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much.
I am trying to use an Asynchronous HTTPListener to create a simple web server in VB .Net (Not ASP) This will be run as a desktop application. My only goal is to be able to request Server Variables from the client. Is there any way to do this from within a HTTPListenerWebServer? I am using the code from the MSDN VB .Net Samples:
[Code]...
I have an editor created invb.net that creates html files. And when i click the button run , the Internet Explorer opens my file that is inside the Richtextbox.
View 3 RepliesI wish to communicate over usb in vb.net i realize i might need to use openfile windows api or createfile windows api but im doing a generic mouse driver which should be miles simpler to do since microsoft and usb.org already have the report descriptors available so all i want to do is just send data to the device directly using my program.
[Code]...
I'm working on a little app which needs to recieve information from a script on a web server. I tried to have the vb.net app pole a php web page for a command every half of a second. This worked but, the app is streaming video and every time the app needs to pole the webpage the video stutter stops. I tried setting the pole timer to 5 seconds and still every 5 seconds the video stutters. I thought that maybe sockets would be the answer, so I looked for examples of vb.net socket servers and php socket clients. I tried implementing a solution but the php cannot seem to connect to the vb.net server. I googled around and saw that maybe php cannot communicate with a vb.net application.
View 1 RepliesIf I control both applications, what is the best way to communicate between 2 exe's written in VB.Net. For example, I want to drop an XML file from one app, and pick it up with the other, but I do not want poll for the file. I've heard of named pipes, but I found it was complicated. What's the most effecient way to do this?
View 4 RepliesI'd like to know what the best way to communicate between two applications via a LAN would be? ..and would it work over multiple versions of Windows (XP, Vista, NT etc..)?
I am setup with Visual Basic Express 2008.
I am a novice with programming and really need to get a device communicate with PC through COM3.
how to send and receive data via COM3 in VB.
I have a Digi Modem connect to a device. How could I sent the code through the IP address what the Modem create to get communicate with my device? how to defined the IP, 2) make the communication 3) sent the code?
View 4 RepliesI am trying to send and receive packets over the LAN (i.e. NIC port) using VB.NET. I found some code that uses Socket wrench, but problem with such solutions is that users will need to install extra drivers and all which I do not want. I am looking to use drivers native to the .NET environment to send and receive packets through the LAN port. My windows forms application is in VB.NETneil
View 1 RepliesI am looking to send and receive packets from the LAN port using some kind of WIndows Native object so that the user of my Windows Forms control does not have to install any third party software.[For example, for Serial port I use MSComm, i want to know what I can use for LAN port?]
View 1 RepliesI`m working on a project where i have connected a FPGA chip to the PCI bus but now i am trying to figure out how to communicate in VB to that device? Normally the device has memory assigned to it in XP (address h00000200 to h0000037F) but i don`t know how to read/Write to that memory directly in VB...
View 2 RepliesI have a library that interacts with our phone system, ie, Hey phone, call this number for me. This library is used in one of our in house products. I would like to put this instead in a service, so that any of our in house products can send the service a message to place a phone call. So basically I want to communicate from a program built in .Net 3.5 with a service running on the same machine also built in the 3.5 framework. I have done some work with WCF and was considering using this but thought I would ask what others have done or would do.
View 4 RepliesRecently, I Developed an Experiment Application with VB.net(in Windows platform), When the application collected the data,I want to use R to Analysis the data, But I don't know how to Communicate with R (In other word, I want to send R script to R in my own application).
View 1 RepliesI have a program that opens the command prompt and sends commands. I need to leave the first CMD open, open ANOTHER cmd and send more commands to the second one.
Then I do some processing and can close them both. How can I open more than one, and how do I refer to the first or second one?
I'm coding a restaurant program where every table, server and guest is a different object - Is there a right way of getting objects to communicate with each other?For example, one server might have 5 table objects, each table might have 2 guest objects. Is there a way to neatly tie all this information together. If a guest moves to a different table I have to change a large number of variables (number of guests served by server, table set to empty, new table sat...etc etc.)?
View 2 Replieshow can I let two threads communicate with each other by using VB.net?
View 3 RepliesI am creating an Excel Add-In using Visual Studio 2010. My intention was to add a context menu to a cell and perform some action on the selected cell or cells. Here is the code I have got as of now
[Code]...
I am writing a VB.Net application wherein I would like to be able to communicate with it from a remote computer. Specifically, I would like to be able to send (from a remote computer) both text data and also images (jpg, png, etc.) and then have the application use the sent information by displaying it to the user. How would I code the VB.Net app to be able to handle incoming data like this?
If possible I'd like to not be dependent on .Net technology on the "sending" side so I'm not sure if I would just use sockets or a web service or what.
I have a problem I have a project that needs to have a communication of asp .net to vb .net my project is i want to access or control(like a remote control) the vb .net application(server) using asp .net(client side) asp .net is like a remote control and the vb .net is the application that needs to control i need to use internet to do that.
View 1 Replies