Hi,

> declare
> Client = {New Open.socket client(host:"google.com" port:80)}
> in
> {Client write(vs:"GET / HTTP/1.0\r\n")}
> {Client write(vs:"\r\n")}
> {System.showInfo {Client read(list:$ size:all)}}
> {Client close}
High level (Open module) uses blocking connect and read/write, if I
remember it correctly the whole Mozart VM freezes.
So I used low level OS interface with readSelect, writeSelect and
undocumented connectNonblocking. I do not know if it works on windows,
but it worked just fine in linux.

Look at URLTextSource function for example:
http://dougdevel.org/cgi-bin/gitweb.cgi?p=WordFinder.git;a=blob;f=TextSources.oz;h=b16a8b715a2240dac60ad1705a957c81ee174c57;hb=b77b61c71ecee2038863f2691ad8ab8cdd0264df#l46

You may be interested in looking at the whole application, because I
scan several pages and collect words. In this case agent diagram may
be helpful
http://courses.cs.ut.ee/2009/cpl/uploads/Main/oz-agents.pdf

Oleg
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to