Yes I have stopped iis
Printable View
Yes I have stopped iis
hmmm...could you post your doListen method for me to have a look at?
Code:Private Sub doListen()
Dim client As System.Net.Sockets.Socket
Dim responseBytes() As Byte
Do
client = listenSocket.Accept() ' When this method returns, "client" will hold the connection to the remote host.
' Send the data here, using the client.Send method.
responseBytes = BuildResponse("C:\page.html")
client.Send(responseBytes, responseBytes.Length, Net.Sockets.SocketFlags.None)
client.Close()
Loop
So you're saying that you can access http://localhost/ once, but the next time it fails? Odd... Try this:
Change your doListen subroutine to this:
And add this subroutine:VB.NET Code:
Private Sub doListen() Dim client As System.Net.Sockets.Socket Dim clientThread As System.Threading.Thread Do client = listenSocket.Accept() ' When this method returns, "client" will hold the connection to the remote host. ' Start a new thread to respond to the client, this will let us ' continue listening for new connections while responding to other hosts. clientThread = New System.Threading.Thread(AddressOf RespondToHost) clientThread.IsBackground = True clientThread.Start(client) Loop End Sub
I find it hard to believe that its the cause, but it might still be busy with the former connection when you try to connect again. This new code will let the server respons to several hosts simultaneously.VB.NET Code:
Private Sub RespondToHost(ByVal obj As Object) Dim resp() As Byte Dim client As System.Net.Sockets.Socket = DirectCast(obj, System.Net.Sockets.Socket) resp = BuildResponse("c:\doc.html") client.Send(resp, resp.Length, Net.Sockets.SocketFlags.None) client.Close() End Sub
testing right now
Nope, still received an error on second refresh. Took 8 refreshes to receive page.What's wierd is once I receive the page I can keep refreshing that tab and never miss a beat.
Problem is that the file is still open maybe?
Ok I will try build app and try on client computer in practice instead of server box.
me.hide or me.visible = 0, or me.visible = false does not make the form invisible.
I need it invisible as I am going to Shell "C:\AppPath" from another program.
You are probably trying to hide it on Form_Load, correct? The form hasnt been displayed when Form_Load is executing so setting Visible to false there isnt going to do much good, as it will be set to True shortly after anyways. You'd need to use the Shown event instead :)
Me.Shown = False
Error 1 'Public Event Shown(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Thinks I am trying to Say Me.Show as in show form.
no, you'll have to handle the event, double-click your form, check the list of event in the upper right corner of the code-area, select Shown in there.Quote:
Originally Posted by samtheman
Thats where you need to set Visible = false.
Done.
So how is it all working for you now? Is it working better on that other computer of yours?
Hi,
Not sure yet as I am installing .NET 3.5 (only had 3 on all my clients). Thank you for all your help, I rated a post of yours, is there a way I can help you in return?
Oh no mate, I'm just happy to help as much as I can. Thanks for the rating :thumb:
Be sure to post here with your results from trying on that other computer.
Perfect. Just one last question, as the application is going to be joined to another. Can I harvest the exe on it's own from the bin release folder. I noticed that most .NET apps use Inno or Nullsoft or their own installer. I have to admit there are no digital signature warnings etc making it better. Point is, can I harvest the exe, will this not make the EXE 'install' but run standalone.
Plus installs do not seem correct with VS2K8, they seem to place inside application data and not C:\Program Files. I have no control over destination with vb installer.
Yes, you can take that EXE and run it without needing to install it, its when you use additional depencies etc that it can be a good idea packaging it in an install package.Quote:
Originally Posted by samtheman
Yeah, thats how it works with the VS installer.Quote:
Originally Posted by samtheman
Okey doke. Just setting a One Instance only setting now. Thanks for all the help. Resolved :)