Monday, November 08, 2010 at 12:06 AM.
system.verbs.builtins.tcp.im.builtinDrivers.aim.code.core.process_loop
on process_loop(adrSelf) {
<<# the "main" loop
local {
event;
ind;
id;
data};
adrSelf^._threadId = thread.getCurrentId();
while true {
try {
event = tcp.im.builtinDrivers.aim.code.core.recv_event(adrSelf)}
else {
try {
delete(@adrSelf^._threadId)};
case adrSelf^._debug {
2 {
scriptError(tryError)};
1;
0 {
return(1)}}};
if not event {
continue};
tcp.im.builtinDrivers.aim.code.core.derror(adrSelf, "RECV :"+ string(event) );
<<#else, fig out what to do with it
<<#special case-- login
if event[1] == 1 {
tcp.im.builtinDrivers.aim.code.core.start_log_in(adrSelf);
continue};
if not event[2] contains ':' {
data = ""}
else {
ind = string.patternMatch(":",event[2]);
id = string.upper(string.mid(event[2], 0, ind-1));
data = string.mid(event[2], ind+1, infinity)};
<<#handle manually now
case id {
"SIGN_ON" {
tcp.im.builtinDrivers.aim.code.core.c_SIGN_ON(adrSelf, id,data)};
"ERROR" {
tcp.im.builtinDrivers.aim.code.core.c_ERROR(adrSelf, id,data)}}
else {
tcp.im.builtinDrivers.aim.code.core._callsub(adrSelf, id, {adrSelf, data}, flThreaded:adrSelf^._flSpawnCallbackThreads)};
}}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.