• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Determining TCP stream end
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining TCP stream end


  • Subject: Determining TCP stream end
  • From: "Tomas Zahradnicky, Jr." <email@hidden>
  • Date: Wed, 13 Feb 2002 15:23:29 +0100

Hello,

I'm programming FTP app using OT. I'm using synchronous non-blocking model with threads and I have this problem:

Server sends me some TCP data stream. So I count the incoming data by OTCountDataBytes and mark that I have to read XYZ bytes from that endpoint. OK, then I issue OTRcv and if T_MORE flag is present, I invoke my notifier with another T_DATA event and I'm doing the same, but:

How do I tell that I've read all the data? i.e. the FTP welcome message is complete and I should issue USER command? I know I can issue it immediately, but if there were some data I need to know about, I cannot tell if I'm finished or not. I can use timeout of say 5 secs, but this is highly ineffective. Do I have to wait until T_MORE flag clear and then consider it read?

The same approach appears after connect. If I do connect I have to wait some time, probably up to some timeout to receive incoming data.

Also one more thing. If I don't issue WaitNextEvent from a separate thread I get no more date. As far as I know this is to let OT process data so EventAvail/SystemTask would be enough, but it is not. Did I miss something?

Thanks,

Tomas
--
# Tomas Zahradnicky, Jr
# The Czech Technical University
# Dept of Computer Science, FEE-CTU Prague
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Determining TCP stream end
      • From: Peter Lovell <email@hidden>
  • Prev by Date: Re: Re(2): Am I Connected (Cont)
  • Next by Date: Re: Determining TCP stream end
  • Previous by thread: Re: nonblocking accept() on MacOS X (ADSP)
  • Next by thread: Re: Determining TCP stream end
  • Index(es):
    • Date
    • Thread