- msg = data_is.Read8();
-
- // OK! Confirmation.
- if (msg == IPC_CONNECT) {
- wxTCPConnection *connection = (wxTCPConnection *)OnMakeConnection ();
- if (connection) {
- if (!connection->IsKindOf(CLASSINFO(wxTCPConnection))) {
- delete connection;
- return NULL;
+ msg = data_is->Read8();
+
+ // OK! Confirmation.
+ if (msg == IPC_CONNECT)
+ {
+ wxTCPConnection *connection = (wxTCPConnection *)OnMakeConnection ();
+
+ if (connection)
+ {
+ if (!connection->IsKindOf(CLASSINFO(wxTCPConnection)))
+ {
+ delete connection;
+ // and fall through to delete everything else
+ }
+ else
+ {
+ connection->m_topic = topic;
+ connection->m_sock = client;
+ connection->m_sockstrm = stream;
+ connection->m_codeci = data_is;
+ connection->m_codeco = data_os;
+ client->Callback(Client_OnRequest);
+ client->CallbackData((char *)connection);
+ client->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
+ client->Notify(TRUE);
+ return connection;
+ }