Click here to Skip to main content
16,007,443 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Humm. Pin
Anders Molin20-May-01 12:07
professionalAnders Molin20-May-01 12:07 
GeneralRe: Humm. Pin
l a u r e n20-May-01 21:26
l a u r e n20-May-01 21:26 
GeneralRe: Humm. Pin
Anders Molin20-May-01 21:35
professionalAnders Molin20-May-01 21:35 
GeneralGetting URL from File Download Launched by CHtmlView Pin
User 1278219-May-01 17:17
User 1278219-May-01 17:17 
QuestionWhat are these messages pointing too?? Pin
19-May-01 15:08
suss19-May-01 15:08 
AnswerRe: What are these messages pointing too?? Pin
Michael Dunn19-May-01 15:49
sitebuilderMichael Dunn19-May-01 15:49 
GeneralExitWindowsEx Pin
19-May-01 12:02
suss19-May-01 12:02 
GeneralWinsock Woes Pin
Stephen Caldwell19-May-01 8:44
Stephen Caldwell19-May-01 8:44 
I was able to solve my own problem. Thanx anyway.


*Obsolete*
I'm creating a multithreaded server application using winsock. So far everything works well except when i try to send data to the client. I get a WSAEINVAL(10022) error on the Send() function. Here's the code:

UINT PASCAL CLJFileServer::ListenProc(LPVOID *pParam)
{
CLJFileServer *pThis;
pThis = (CLJFileServer*)pParam;

if (!pThis)
return 1;

CTimeoutSocket* pClient = NULL;
CTimeoutSocket* pListen = new CTimeoutSocket();

int nLoopCount;
while (!pListen->Create(pThis->m_uPort))
{
Sleep(LJFS_TIMEOUT);
nLoopCount++;
if (nLoopCount > LJFS_SOCKET_RETRY)
{
pThis->m_hListen = NULL;
pThis->StartListening();
return 1;
}
}

pListen->Listen();

while(pThis->m_bStop != true)
{
if (pClient)
delete pClient;

pClient = new CTimeoutSocket;
pListen->SetTimeout(LJFS_TIMEOUT);
int bAccepted = pListen->Accept(*pClient);
if (bAccepted)
{
pThis->SendAck(pClient);

if (pThis->m_uServerType == LJFS_LISTEN)
pThis->Login(pClient);
else
pThis->ForwardConnection(pClient);
}

}
if (pClient)
delete pClient;

pListen->Close();
delete pListen;
pThis->m_hListen = NULL;
return 0;
}

void CLJFileServer::SendAck(CTimeoutSocket *pClient)
{
//pClient->Bind(LJ_FSPORT);
TRACE("Error No: %d", GetLastError());
if(m_uServerType = LJFS_LISTEN)
{
pClient->Send((void*)LJ_LOGINACK,sizeof(LJ_LOGINACK));
TRACE("Error No: %d", GetLastError());
}
else
pClient->Send((void*)LJ_METASERVER,sizeof(int));
}

Thanx for your help in advance.

Stephen Caldwell
Desick Information Technologies
Generalstatic CArray Pin
derhackler19-May-01 3:41
derhackler19-May-01 3:41 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 7:52
Igor Sukhov19-May-01 7:52 
GeneralRe: static CArray Pin
derhackler19-May-01 7:58
derhackler19-May-01 7:58 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 8:09
Igor Sukhov19-May-01 8:09 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 8:11
Igor Sukhov19-May-01 8:11 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 8:11
Igor Sukhov19-May-01 8:11 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 8:13
Igor Sukhov19-May-01 8:13 
GeneralRe: static CArray Pin
derhackler19-May-01 8:16
derhackler19-May-01 8:16 
GeneralRe: static CArray Pin
derhackler19-May-01 8:15
derhackler19-May-01 8:15 
GeneralRe: static CArray Pin
Igor Sukhov19-May-01 8:20
Igor Sukhov19-May-01 8:20 
GeneralRe: static CArray Pin
derhackler19-May-01 8:25
derhackler19-May-01 8:25 
GeneralTreeView and ListCtrl Pin
BLaZe19-May-01 3:18
BLaZe19-May-01 3:18 
GeneralRe: TreeView and ListCtrl Pin
Steve Driessens19-May-01 3:48
Steve Driessens19-May-01 3:48 
GeneralRe: TreeView and ListCtrl Pin
BLaZe19-May-01 4:16
BLaZe19-May-01 4:16 
GeneralRe: TreeView and ListCtrl Pin
l a u r e n19-May-01 3:53
l a u r e n19-May-01 3:53 
GeneralRe: TreeView and ListCtrl Pin
BLaZe19-May-01 4:15
BLaZe19-May-01 4:15 
GeneralRe: TreeView and ListCtrl Pin
l a u r e n20-May-01 3:14
l a u r e n20-May-01 3:14 

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.