Josh Leder wrote: > Hello > > I'm using ICS v7 as a SOCKS4 server. I've got a TWSocketServer > component that accepts clients, and performs beautifully in most > circumstances. The issue I'm having is that often an HTTP client will > send its request and then perform a shutdown(SD_SEND), waiting to > receive response data from the HTTP server which will then perform > its own shutdown(SD_SEND). > > The TWSocketServer seems to process this as an OnClientDisconnect > event, while the TWSocketClient class just performs an > OnDataAvailable, and Client.Receive returns 0 which is the standard > behaviour to indicate a shutdown(SD_SEND) event from the SOCKS peer. > > Is there any way to prevent the Server.OnClientDisconnect in this > case?
Yes, I think so. > I'd like to pass the shutdown(SD_SEND) to the remote (proxied) > host and maintain the TWSocketClient connection open until both sides > have closed the connection normally. You could override procedure TCustomWSocket.Do_FD_CLOSE(var msg: TMessage); in your custom TWSocketClient class in order to delay the shutdown. However make sure that you call TriggerSessionClosed() (later on) otherwise TWSocketClient objects would leak. -- Arno -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be