Click here to Skip to main content
15,914,070 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: zip format using md5 rather than crc32? Pin
Christian Graus30-Jan-07 16:19
protectorChristian Graus30-Jan-07 16:19 
GeneralRe: zip format using md5 rather than crc32? Pin
Seungbeom Roh30-Jan-07 16:22
Seungbeom Roh30-Jan-07 16:22 
GeneralRe: zip format using md5 rather than crc32? Pin
Hamid_RT31-Jan-07 19:58
Hamid_RT31-Jan-07 19:58 
QuestionOne last IOCP question :) Pin
Polity4h30-Jan-07 11:51
Polity4h30-Jan-07 11:51 
AnswerRe: One last IOCP question :) Pin
Mark Salsbery30-Jan-07 12:21
Mark Salsbery30-Jan-07 12:21 
GeneralRe: One last IOCP question :) Pin
Polity4h30-Jan-07 12:55
Polity4h30-Jan-07 12:55 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery30-Jan-07 13:42
Mark Salsbery30-Jan-07 13:42 
GeneralRe: One last IOCP question :) Pin
Polity4h30-Jan-07 14:04
Polity4h30-Jan-07 14:04 
sure:
int Recieve(char* buffer, size_t buflen){
    if (m_iLastRecieved > 0){ //Were expecting a second packed
        m_wsaBuf.len = static_cast<ULONG>(buflen) - m_iTotalRecieved;
        m_wsaBuf.buf = buffer + m_iTotalRecieved;
        m_wsaBuf.buf[0] = 0;
    }
    else{
        buffer[0] = 0;
        m_wsaBuf.len = static_cast<ULONG>(buflen);
        m_wsaBuf.buf = buffer;
    }

    static int sockaddr_len = sizeof(sockaddr_in);
    DWORD temp(0);
    setStatus(RequestRecieve);
    //returning 0 is ok
    return (PostQueuedCompletionStatus(m_hIOCP, 1, reinterpret_cast<ULONG_PTR>(this), getOverlapped()) == FALSE);
}

Thats where i make my request to post. You might wonder if it aint dangerous for the buffer to overflow or something but most of the checking goes outside this function and i can assure that there is no overflow since i'm only testing with 1 game which is secured in any way i know off.

The requested bytes is unknown, it can variate depending on the used game from like 100 to a few packets of 1500 kb however mostly its just something like 1 packet with 600 bytes (i know because my previous version of the application worked perfectly, only it wasnt using IOCP just the lame one thread per server way ) anyways, with this topic still being open and all, there is one other ugly thing i cant find a good solution for. Is there any way to close a overlapped operation because i need to reuse the overlapped structures, and that means that if there is a timeout check function somewhere in my application just running once in a while over all the overlapped operations looking if they arent timed out because it could hapen that one of the 1000 servers wont give a response for some or other reason and else the overlapped structure would be in use all the time waiting for nothing to come.
GeneralRe: One last IOCP question :) Pin
Mark Salsbery30-Jan-07 14:39
Mark Salsbery30-Jan-07 14:39 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery30-Jan-07 14:48
Mark Salsbery30-Jan-07 14:48 
GeneralRe: One last IOCP question :) Pin
Polity4h1-Feb-07 9:30
Polity4h1-Feb-07 9:30 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery1-Feb-07 10:19
Mark Salsbery1-Feb-07 10:19 
GeneralRe: One last IOCP question :) Pin
Polity4h1-Feb-07 11:08
Polity4h1-Feb-07 11:08 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery1-Feb-07 11:12
Mark Salsbery1-Feb-07 11:12 
GeneralRe: One last IOCP question :) Pin
Polity4h1-Feb-07 11:31
Polity4h1-Feb-07 11:31 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery1-Feb-07 11:53
Mark Salsbery1-Feb-07 11:53 
GeneralRe: One last IOCP question :) Pin
Polity4h1-Feb-07 11:54
Polity4h1-Feb-07 11:54 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery1-Feb-07 11:58
Mark Salsbery1-Feb-07 11:58 
GeneralRe: One last IOCP question :) Pin
Polity4h1-Feb-07 12:05
Polity4h1-Feb-07 12:05 
GeneralRe: One last IOCP question :) Pin
Mark Salsbery1-Feb-07 12:12
Mark Salsbery1-Feb-07 12:12 
Questiondisappearing check boxes Pin
maladuk30-Jan-07 11:13
maladuk30-Jan-07 11:13 
AnswerRe: disappearing check boxes Pin
James R. Twine30-Jan-07 11:23
James R. Twine30-Jan-07 11:23 
GeneralRe: disappearing check boxes Pin
maladuk30-Jan-07 23:31
maladuk30-Jan-07 23:31 
AnswerRe: disappearing check boxes Pin
PJ Arends30-Jan-07 15:51
professionalPJ Arends30-Jan-07 15:51 
GeneralRe: disappearing check boxes Pin
maladuk30-Jan-07 22:40
maladuk30-Jan-07 22:40 

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.