When an input stream containing audio data is opened, the following slots will be set:
audioChannels audioSampleRate audioBitRate audioDuration audioFrameCountWhen an input stream containing video data is opened, the following slots will be set:
framePeriod videoDuration videoFrameCount
if(streamDestination, streamDestination write(outputBuffer)) outputBuffer empty
sensors = AppleSensors clone value := sensors getRightLightSensor
Note: This addon is only needed for async file request - all socket ops are already asynchronous in Io.
bf = Blowfish clone
bf setKey("secret")
bf beginProcessing
bf inputBuffer appendSeq("this is a message")
bf process
bf endProcess
bf outputBuffer // this contains the encrypted data
#!./ioServer
cgi = CGI clone
redirect = cgi getParameters at("redirurl")
if (redirect and redirect != "",
redirect clipAfterStartOfSeq("\r")
redirect clipAfterStartOfSeq("\n")
cgi redirect(redirect)
System exit(0)
)
cgi header("Content-type", "text/html")
cgi write("<html><head><title>test</title><body>")
cgi write("GET Parameters:")
cgi getParameters foreach(k, v,
cgi write(k .. " = " .. v .. ","))
)
cgi write("POST Parameters:")
cgi postParameters foreach(k, v,
cgi write(k .. " = " .. v .. ","))
)
cgi write("COOKIES:")
cgi cookies foreach(k, v,
cgi write(k .. " = " .. v .. ",")
)
fileName content (raw content of file as Sequence) contentType contentEncoding size (in characters/bytes) asString (pretty string of name, type, size)
Every N number of object allocs, the collector will walk some of the objects marked as gray, marking their connected white objects as gray and turning themselves black. Every M allocs, it will pause for a sweep where it makes sure all grays are marked black and io_frees all whites.
If the sweepsPerGeneration is set to zero, it will immediately mark all blacks as white again and mark the root objects as gray. Otherwise, it will wait until the sweepsPerGeneration count is reached to do this. By adjusting the allocsPerSweep and sweepsPerGeneration appropriately, the collector can be tuned efficiently for various usage cases. Generally, the more objects in your heap, the larger you'll want this number.
messageForString(aString, optionalLabelString)
Curses init Curses move(5, 7) print(\"Hello\") Curses refresh Curses end
Person := DBIRecord clone do (fullName := method(firstName.." "..lastName))
q := conn query("SELECT id, firstName, lastName FROM people")
q foreach(Person, p, writeln("Name = ", p fullName))
As you can see, fullName was not in the SQL query, however, a dynamic method
in your Person class.
DBIRecord in and of itself provides no real functionality. It simply acts
as an Object and stores the values from the SQL query into a Map. You can
access the field information:
o := r populate(Person)
o firstName // would retrieve the firstName value of the SQL query
o setFirstName("John") // would update the object's firstName value to be John
Do not confuse the above example as updating the actual database. The call
to setFirstName only updates the objects representation of firstName.
r := conn query("SELECT * FROM people")
r foreach(r, r at(1))
The above would start at the first row, however, you can move around in the
result set and then foreach would pickup where you left off, for instance, say
you wanted to skip the first three rows:
r := conn query("SELECT * FROM people")
r seek(4)
r foreach(r, r at (1))
The above would start at the record #4, not at the beginning.
The optional Object parameter would cause a decendent of DBIRecord to be
populate instead of the index being set. This allows for advanced
functionality. Please see `DBIRecord' for further information and an example.
dnsQueryPacketForHostName(hostNameSeq)
addCoro(aCoro)
DNSResolver addDNSServerIp("128.105.2.10")
ipForYahoo := DNSResolver ipForHostName("yahoo.com")
con := DOConnection clone setHost("127.0.0.1") setPort(8456) connect
result := con serverObject test(1)
writeln(result)
r := result at(0)
writeln(r)
r := result at(1)
writeln(r)
Implementation Notes:
The format of the Distributed Objects message is a list of NullCharacter terminated strings in one of these two formats:
Send message format:
s NullCharacter targetId NullCharacter messageName NullCharacter argCount NullCharacter argType NullCharacter argValue NullCharacter (next arg type and value, etc)Reply message format:
r NullCharacter argType NullCharacter argvalue NullCharacterIf the argument is not a String, Number or nil then: If it is local to the sender, the type is RemoteObject. If it is a proxy to a remote object, the type is LocalObject. This isn't optimized yet.
Test := Object clone
Test test := method(v,
write("got test '", v, "'\n")
return List clone append(1)
)
doServer := DOServer clone
doServer setRootObject(Test clone)
doServer setPort(8456)
doServer start
%a abbreviated weekday name (Sun, Mon, etc.) %A full weekday name (Sunday, Monday, etc.) %b abbreviated month name (Jan, Feb, etc.) %B full month name (January, February, etc.) %c full date and time string %d day of the month as two-digit decimal integer (01-31) %H hour as two-digit 24-hour clock decimal integer (00-23) %I hour as two-digit 12-hour clock decimal integer (01-12) %m month as a two-digit decimal integer (01-12) %M minute as a two-digit decimal integer (00-59) %p either "AM" or "PM" %S second as a two-digit decimal integer (00-59) %U number of week in the year as two-digit decimal integer (00-52) with Sunday considered as first day of the week %w weekday as one-digit decimal integer (0-6) with Sunday as 0 %W number of week in the year as two-digit decimal integer (00-52) with Monday considered as first day of the week %x full date string (no time); in the C locale, this is equivalent to "%m/%d/%y". %y year without century as two-digit decimal number (00-99) %Y year with century as four-digit decimal number %Z time zone name (e.g. EST); null string if no time zone can be obtained %% stands for '%' character in output string.
Coroutine currentCoroutine setMessageDebugging(true)
Then each message sent within that coroutine will cause the Debugger
vmWillSendMessage slot to be activated and the Debugger slots:
messageCoroutine, messageSelf, messageLocals, and message will be set with the
values related to the current message send. You can override vmWillSendMessage to
implement your own debugging mechanisms.