Desperation question - What can I do to start solving this apparent filePointer issue

Hello all,

Command A:

  1. Connects to a socket; (fsockopen
  2. Reads server response after connection; (fread)
  3. Builds the Login XML;
  4. Sends the Login XML; (fwrite)
  5. Reads the server response to the login send; (fread)
  6. Saves the good login response.
  7. Logout - but don’t close the socket connection;

If login ok, keep going:

  1. Builds XML
  2. Send XML (fwrite)
  3. Receive server response (fread)
  4. Saves the good response.

Command B:

  1. Connects to a socket; (fsockopen
  2. Reads server response after connection; (fread)
  3. Builds the Login XML;
    4) Sends the Login XML; (fwrite)
  4. Reads the server response to the login send; (fread)
  5. Saves the good login response.
  6. Logout - but don’t close the socket connection;

If login ok, keep going:

  1. Builds XML
  2. Send XML (fwrite)
  3. Receive server response (fread)
  4. Saves the good response.

(does exactly the same things as Command A) but the XML build
are different.

I can RUN Command A on one file;
I can RUN Command B on another file;
Both, successfully.

When I try to RUN both (on series, like, do one and immediately after it do the other), I can’t.

All seems to work great until I reach point 4 of command B.
I’m getting an error telling me, sort of “there is nothing to read from”. :s

My hope is that, perhaps, this could be an issue that is related with the fread fwrite order, and I’m messing this somehow and that, some among you, can figure out, what could it be. :injured:

If, by any chance, you can take me out of this maze, I will appreciate. :s

K. Regards,
Márcio

Not yet solved but I’m not on a maze anymore.

The issue is ALSO probably related with this fwrite and fread usage BUT, it can be solved on a new way (and better) to reorganize the methods and classes that make this happen.

Thanks again, case solved or, at least, partially solved. :slight_smile:
Márcio