#pragma hdrstop
#endif
+#if wxUSE_SOCKETS
+
#ifndef WX_PRECOMP
#endif
return TRUE;
}
-bool wxTCPConnection::Execute (char *data, int size, wxIPCFormat format)
+bool wxTCPConnection::Execute (wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return FALSE;
m_codeco->WriteString(data);
else {
m_codeco->Write32(size);
- m_codeco->Write(data, size);
+ m_sockstrm->Write(data, size);
}
return TRUE;
s = m_codeci->Read32();
data = new char[s];
- m_codeci->Read(data, s);
+ m_sockstrm->Read(data, s);
if (size)
*size = s;
}
}
-bool wxTCPConnection::Poke (const wxString& item, char *data, int size, wxIPCFormat format)
+bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return FALSE;
m_codeco->WriteString(data);
else {
m_codeco->Write32(size);
- m_codeco->Write(data, size);
+ m_sockstrm->Write(data, size);
}
return TRUE;
// Calls that SERVER can make
bool wxTCPConnection::Advise (const wxString& item,
- char *data, int size, wxIPCFormat format)
+ wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return FALSE;
m_codeco->WriteString(data);
else {
m_codeco->Write32(size);
- m_codeco->Write(data, size);
+ m_sockstrm->Write(data, size);
}
return TRUE;
wxTCPConnection *connection = (wxTCPConnection *)cdata;
wxDataInputStream *codeci;
wxDataOutputStream *codeco;
+ wxSocketStream *sockstrm;
wxString topic_name = connection->m_topic;
wxString item;
// Receive message number.
codeci = connection->m_codeci;
codeco = connection->m_codeco;
+ sockstrm = connection->m_sockstrm;
msg = codeci->Read8();
switch (msg) {
format = (wxIPCFormat)codeci->Read8();
size = codeci->Read32();
data = new char[size];
- codeci->Read(data, size);
+ sockstrm->Read(data, size);
connection->OnExecute (topic_name, data, size, format);
format = (wxIPCFormat)codeci->Read8();
size = codeci->Read32();
data = new char[size];
- codeci->Read(data, size);
+ sockstrm->Read(data, size);
connection->OnAdvise (topic_name, item, data, size, format);
case IPC_POKE: {
wxIPCFormat format;
size_t size;
- char *data;
+ wxChar *data;
item = codeci->ReadString();
format = (wxIPCFormat)codeci->Read8();
size = codeci->Read32();
- data = new char[size];
- codeci->Read(data, size);
+ data = new wxChar[size];
+ sockstrm->Read(data, size);
connection->OnPoke (topic_name, item, data, size, format);
codeco->Write8(IPC_REQUEST_REPLY);
if (user_size != -1) {
codeco->Write32(user_size);
- codeco->Write(user_data, user_size);
+ sockstrm->Write(user_data, user_size);
} else
codeco->WriteString(user_data);
} else
}
}
}
+
+#endif
+ // wxUSE_SOCKETS