Im trying to send an array from the server application to the client on the same machine. The array is loaded and Sent from the server and recieved at the client but the array seems to be empty on the client side. I am using the socket.Receive function on the client side. I can send string messages back and forth without any problems. I am using Visual C++ MFC IDE tool to generate program.
Code:
//This is the server side declaration and Socket Send. I know that on the array has data in it on the server side
struct Countries
{
CString m_strCountries;
double m_lOffset;
CString m_strSummer;
};
Countries Acountries[CLEN];
iSent = m_sConnectSocket.Send(Acountries,NULL,NULL);
//This is the client side declaration an Socket Receive
struct Countries
{
CString m_strCountries;
double m_lOffset;
CString m_strSummer;
};
Countries Acountries[CLEN];
iRcvd = m_sConnectSocket.Receive(Acountries,NULL,NULL);
//Receive the message ** This is what I use to get the string
// messages that work correctly for both client and server
char *pBuf = new char[1025];
int iBufSize = 1024;
iRcvd = m_sConnectSocket.Receive(pBuf, iBufSize);
Any and all comments greatly appreciated.
MER