News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
socket.http bug or aminotdoinitrite?
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: socket.http bug or aminotdoinitrite?

I think I found a solution of some kind, by testing the server first, and then the files on it

Code:
host="somehostname"
-- check is server is available
testy=socket.protect(function()
  local c = socket.connect(host, 80)
  if not c then fltk.fl_alert("server not found!"); os.exit()
  else c:close() end
end)
testy()

host="http://"..host.."/media"
-- check if the media dir is available
local b,c=socket.http.request(host)
if c~=200 then fltk.fl_alert("media not available"); os.exit() end

This post was last modified: 12-28-2010 02:09 PM by mikshaw.

12-28-2010 02:07 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: socket.http bug or aminotdoinitrite? - mikshaw - 12-28-2010 02:07 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: