| Dart Home | PowerTCP Emulation for ActiveX | Custom Development | Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Emulation / Telnet for ActiveX Topic: how to clear receive buffer? or how to read all data? |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 14, 2004 6:39 PM I am trying to send a command to a telnet server and grab the response up to the prompt. I keep getting nothing in my return string. Is there an obvious error here? dim b as boolean, r as long r = Telnet1.Send("VIEW 12 F800H" + vbCrLf) b = WaitFor("*>", 9000, s) This is supposed to return something like this (w/o quotes): " 12:F800h 0001h *> " but all I keep getting are these 6 bytes: " *> " [crlf * > crlf] So I'm thinking that the receive buffer needs to be dumped before I send the VIEW command above but I don't know how to do that. I'm using a non-blocking connection, but blocking for the WaitFor() routine. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 15, 2004 9:05 AM Please send a very simple sample application that demonstrates what you are trying to do. Please don't send your entire application, just narrow it down to the part you are having a problem with. I need to see exactly what you are doing and be able to make modifications to the program if necessary. Send the program in a zip file to support@dart.com |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 15, 2004 3:26 PM Code sent as sample1.zip to support@dart.com as requested. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 15, 2004 3:39 PM What you sent was a text file. I need an actual project so that I can see if you are doing anything wrong. Also, we will need your real name, telephone number (in case we need to reach you with questions) and company info. |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 15, 2004 4:07 PM The problem is that you won't be able to connect to the hardware to see what it returns, so all you can do is study my code. I recreated the smallest project that demonstrates the problem, but I don't know how it will help. I'm unable to open a whole in the firewall to allow you to connect to the hardware device itself. I'll update my profile (I don't normally give out my real info when registering on forums due to spam/ID theft/etc) I'll send a copy of my project shortly. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 15, 2004 4:17 PM Just provide the info when you email, you don't need to do it here. |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 15, 2004 4:21 PM tester.zip sent per request. it's a full project, and does the _very_ same thing that my big app does (related to the telnet problem). I'm hoping you'll look at the code and go "ohhh, you need to move this statement from here to here..." or something equally easy!!! :) Thanks! (Already updated the profile here..) |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 15, 2004 4:53 PM Unfortunately, it's not going to be that easy. I see many things wrong with your code. I'll try to list the most obvious here. By the way, have you looked at any of the sample programs yet? List of things that are wrong: 1) It looks like you want to use this asynchronously because you set timeout to 0. However, you don't even have a receive event, which is where you receive when using async mode 2) For some reason you are calling the Sleep function. You can't do that. It causes messages to stop and events don't get fired. I'm not sure but it may even cause data to be lost. Please take a look at all the samples. They should give you what you need to get started. |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 15, 2004 5:02 PM ok. I removed all Sleep() commands and also removed all the assignments of Telnet1.Timeout=0 from the code, and it still does the same thing...(ie. doesn't return all the text) I followed the samples to get this far, but they do not show enough detail. I don't know what happens in the "magical" Telnet1.Search method -- where does the data go that it receives prior to finding the token? Then what happens to the data from the server after that function exits after finding the token? Is it still sitting in a buffer somewhere waiting for a Telnet1.receive() command to grab it? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 15, 2004 5:12 PM This is going to be too complex for the forum. I'll have someone contact you on Monday regarding our more advanced support options. |
| Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|