Hi, Unicon Group,

We want to gather info from some websites at the same time. I learned that 
there was not thread in Unicon/Icon, Jeffery told me select() could help.

I tried, but the code following just could deal with one url connection.
Maybe you could give me some example code.

----------------------------------------------------------------------------
  s_url_car := "www.google.com"
  p_url_car := open(s_url_car, "m") | stop("\tError : Can't connect ",s_url_car)

  s_url_licence := "www.vanfuture.com"
  p_url_licence := open(s_url_licence, "m") | stop("\tError : Can't connect 
",s_url_licence)
  
    while *(l_p_url:=select([p_url_car,p_url_licence],2000)) = 0 do
        stop("\n\t- error : connection timeout! check the connection pls.\n")

    (&errno = 0) | stop("Select failed: ", &errortext)
    every p_temp := !l_p_url do 
    {
      if p_temp === p_url_car
      then deal_car(p_url_car)
    
      if p_temp === p_url_licence
      then deal_licence(p_url_licence)
    } # every

procedure deal_car(p_url_car)
...
end

procedure deal_licence(p_url_licence)
...
end
----------------------------------------------------------------------------

Reply via email to