pmsumner: (Default)
posted by [personal profile] pmsumner at 06:10pm on 28/02/2009 under ,
I experimented with callbacks and waiting on signals, but couldn't sort my logic out. I could make it work when I was receiving a stream of data back, but I need to receive, wait for a prompt, send and wait for a prompt, send again then wait for a prompt. I couldn't make out how to do this and separate the wait/check for prompt functionality from the receiving data functionality which could end up messy.

I thought I was being very clever by using the "txtResponse.textChanged" event to check for the prompt, but forgot that the server echoes back what's sent to it. Though having said that, I would only need to change my checking, as I was using inStr(response, "Username:" ) but could use response.endsWith or similar.

Hmmmm.

Anyhow, I'm now back to using the winsock send/receive functionality through the Winsock Revamped component found here (http://www.codeproject.com/KB/IP/winsock_revamped.aspx). It's working, but I don't like the way I've made it work. It's untidy and probably "dangerous".

What I really need to find is some examples of some similar application, but the only examples that I can find are really simple ones that send data and receive it, but don't necessarily have a "flow" to them, where there may be login prompts involved.
Mood:: 'tired' tired

May

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31