P
Peter Judge
Guest
Hey Onno, There HTTP library listens for timeouts and throws an error if one happens. An OpenEdge.Net.HTTP.HttpRequestError is thrown (which is an AppError). See github.com/.../ABLSocketLibrary.cls The ClientSocket used by the HTTP library publishes a number of events; you could subscribe to them from the code that instantiates the HTTP client. /** Event fired when a chunk of data is received from the socket */ define public event DataReceived signature void ( input poSender as ClientSocket, input poEventArgs as SocketReadEventArgs). /** Fired when a read times out (optional based on a timeout) */ define public event ReadTimeout signature void ( input poSender as ClientSocket, input poEventArgs as SocketReadEventArgs). /** Fired when a read is terminated for an reason (socket disconnect, no data etc) */ define public event ReadTerminated signature void ( input poSender as ClientSocket, input poEventArgs as SocketReadEventArgs). The code at github.com/.../set_options.p shows how you can use a ClientSocket object of your choosing (from which you'd subscribe to the events). Note that if you go this route, - you have to be careful of holding on too long, and preventing GC of the socket - I'm not sure of the program flow, since an error is thrown (as opposed to added to the EventArgs object); I'd have a catch block in place. hth, -- peter
Continue reading...
Continue reading...