I am using ICS-V7 Distribution (October, 2010). I have encountered a problem when using this component: I make a Connect() call to invalid address(that is no guy listen on that address and that port), after a while, the OnChangeState event fired, with the NewState = wsConnected, in this case, when I am tried to write to the socket,
an OnChangeState event with the NewState = wsDisconnected fired.

Is it excepted behavior?

Yes, it is expected. When you connect, you always goes thru the OnSessionConnected event (and corresponding OnChangeState). If the connection fails, OnSessionConnected has a non zero error argument. Then later you pass thru the OnSessionClosed.

You should not use OnChangeState event for anything else than displaying some UI feedback. For processing, use OnSessionConnected, OnSessionClosed and OnDataAvailable.

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

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

Reply via email to