eXceed69 2 Posting Pro

Our servers is crashing everytime when my client scan my ports. And due minimal documentation since the code is writen few few years ago the only thing I could do is just recreate the whole event. below are the piece of the function that error and its exception tells that it due to a "bad file" event.

jok_cJocket jok_cListener::Accept(){
  jok_cJocket NewJocket;
 if ( m_pJocket->GetJocket() < 0 ) {
    throw JOK_cEX("jok_cListener::Accept(): Socket hasn't been created");
  }
  NewJocket.SetJocket(accept(m_pJocket->GetJocket(), NULL, NULL));
  if ( NewJocket.GetJocket() < 0 ) {
    m_pJocket->Close();
    NewJocket.Close();
    string errData = "jok_cListener::Accept(): ";
    errData += strerror(errno);
    throw JOK_cEX(errData);
  }

Any suggestion to not to throw this error

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.