login about faq

Hi,

I have a following little code for server side:

Dim listenSocket As New ChilkatSocket
Dim success As Long
success = listenSocket.BindAndListen(8051, 25)
Dim connectedSocket As ChilkatSocket
Do
Set connectedSocket = listenSocket.AcceptNextConnection(0)
seg$ = connectedSocket.ReceiveUntilMatch("¤¤¤END¤¤¤")
success = connectedSocket.Close(50)
Set connectedSocket = Nothing
If Left(seg$, 4) = "STOP" Then Exit Do d = DoEvents
Loop

It works fine but i can stop the running of the code in VB6 design mode when i send the 'STOP' word from the client side. The Ctrl+Break key combination dont't work so i can't switch to debug mode. What should i change for a breakable code? Thanks for your answer.

Best regards:

Máté György

asked Oct 12 at 10:20

Fureka's gravatar image

Fureka
3115


I tried your code and it work if I typed:

STOP¤¤¤END¤¤¤

Since you are waiting on "¤¤¤END¤¤¤", you have to make sure to send that string to return control to your code.

link

answered Oct 12 at 12:07

jpbro's gravatar image

jpbro ♦
1.1k2618

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×81
×39
×14

Asked: Oct 12 at 10:20

Seen: 50 times

Last updated: Oct 12 at 12:07

powered by OSQA