Click here to Skip to main content
15,910,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: array of components 2d Pin
David Crow13-Oct-04 9:03
David Crow13-Oct-04 9:03 
GeneralRe: array of components 2d Pin
K.A.L14-Oct-04 3:58
K.A.L14-Oct-04 3:58 
GeneralRe: array of components 2d Pin
Kevin McFarlane13-Oct-04 6:33
Kevin McFarlane13-Oct-04 6:33 
GeneralRe: array of components 2d Pin
K.A.L13-Oct-04 9:01
K.A.L13-Oct-04 9:01 
GeneralRe: array of components 2d Pin
Kevin McFarlane13-Oct-04 22:36
Kevin McFarlane13-Oct-04 22:36 
GeneralRe: array of components 2d Pin
K.A.L14-Oct-04 3:57
K.A.L14-Oct-04 3:57 
GeneralHelp ! hook java application by VC++ Pin
crazymanhehe13-Oct-04 1:32
susscrazymanhehe13-Oct-04 1:32 
GeneralCreating Server application using CAsyncSocket Pin
prasanna kankanalapalli13-Oct-04 0:52
prasanna kankanalapalli13-Oct-04 0:52 
I am creating a server application using CAsyncSocket , i am able to recieve information from a client , how could i send reply back to connected client , at present i am able to accept only one client how could i make it for multiple clients...

this is code that i had written...

here async is a class derived from CAsyncSocket....

void async::OnAccept(int nErrorCode)
{

if( recvsocket==NULL )
recvsocket = new async;
//Create the new connection
if( Accept( *recvsocket,NULL,NULL ) == 0 )
{
return;
}
CAsyncSocket::OnAccept(nErrorCode);
}

here i declared recvsocket as

async* recvsocket;

in the async class....


void async::OnReceive(int nErrorCode)
{


char *pBuf = new char[1025];
int iBufSize = 1024;
int iRecv, iErrCode;
CString strRecv, Emsg;

iRecv = Receive(pBuf,iBufSize);
if (iRecv == SOCKET_ERROR)
{
iErrCode = GetLastError();
Emsg = "Error found! Error code: " + iErrCode;
AfxMessageBox(Emsg);
}
else
{
pBuf[iRecv] = NULL;
strRecv = pBuf;
AfxMessageBox(strRecv);


/* if (recvsocket->Send(pBuf,iBufSize) == SOCKET_ERROR)
{

AfxMessageBox("Send Error");
}
else
{
AfxMessageBox("sended");
}
*/
}

CAsyncSocket::OnReceive(nErrorCode);
}

Thank u.

Prasanna
GeneralInterfacing with C# .net web service from C++ .net Pin
Member 131514813-Oct-04 0:31
Member 131514813-Oct-04 0:31 
Generalagain IContextMenu Pin
mazur197313-Oct-04 0:01
mazur197313-Oct-04 0:01 
QuestionRealTime Priority? Pin
Manikandan12-Oct-04 23:40
Manikandan12-Oct-04 23:40 
AnswerRe: RealTime Priority? Pin
Arsalan Malik13-Oct-04 2:07
Arsalan Malik13-Oct-04 2:07 
AnswerRe: RealTime Priority? Pin
Antony M Kancidrowski13-Oct-04 2:33
Antony M Kancidrowski13-Oct-04 2:33 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 5:22
Manikandan13-Oct-04 5:22 
GeneralRe: RealTime Priority? Pin
Antony M Kancidrowski13-Oct-04 5:33
Antony M Kancidrowski13-Oct-04 5:33 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 6:20
Manikandan13-Oct-04 6:20 
GeneralRe: RealTime Priority? Pin
Antony M Kancidrowski13-Oct-04 11:41
Antony M Kancidrowski13-Oct-04 11:41 
AnswerRe: RealTime Priority? Pin
geo_m13-Oct-04 21:42
geo_m13-Oct-04 21:42 
GeneralRe: RealTime Priority? Pin
Manikandan13-Oct-04 21:51
Manikandan13-Oct-04 21:51 
GeneralRe: RealTime Priority? Pin
geo_m14-Oct-04 0:28
geo_m14-Oct-04 0:28 
GeneralVectors vs Arrays Pin
mcsherry12-Oct-04 23:03
mcsherry12-Oct-04 23:03 
GeneralRe: Vectors vs Arrays Pin
V.12-Oct-04 23:37
professionalV.12-Oct-04 23:37 
GeneralRe: Vectors vs Arrays Pin
mcsherry12-Oct-04 23:47
mcsherry12-Oct-04 23:47 
GeneralRe: Vectors vs Arrays Pin
Mike Beckerleg13-Oct-04 0:05
Mike Beckerleg13-Oct-04 0:05 
GeneralRe: Vectors vs Arrays Pin
Kevin McFarlane13-Oct-04 6:36
Kevin McFarlane13-Oct-04 6:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.