• 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
Re: Open Transport file transfers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Transport file transfers


  • Subject: Re: Open Transport file transfers
  • From: Matt Mashyna <email@hidden>
  • Date: Thu, 20 Feb 2003 08:49:28 -0500

I hope my memory is correct. I ran into something like this when I ported my FTP client to carbon. It was really sluggish when I did the port and I tracked it down to the WNE loop. It behaved much differently on X than it did in 8/9. My transfer is done in a thread that calls YieldToAnyThread often enough to let other processes breath while it's going. It's early and I'm trying to remember from two years ago so cut me some slack if I'm dreaming. If I remember right, it was a matter of balancing the sleep time on the WNE loop so that the main thread and the transfer thread didn't starve each other. On X a high sleep time made the transfer sluggish. On 8/9 a low sleep time made the transfer sluggish. So, I check the OS and set it accordingly.

Here's a snippit from my code:

int main(void)
{
EventRecord gEvent;
OSErr err;
short windowCode;
WindowPtr whatWindow;
long sleepTime = 15;

long CarbonVersion = 0;
OSErr gestErr = Gestalt(gestaltCarbonVersion, &CarbonVersion);
if(gestErr || CarbonVersion < 0x0140)
{
::StopAlert(999, nil);
return 0;
}

InitEverything();
if(IsOS_X())
sleepTime = 1;

progress = new ProgressWindow;

err = CreateThreadPool(kCooperativeThread, 4, 0);

progress->SetFileCount(0,0);
progress->SetInfo("");
progress->SetStatus("Idle");

while(!gDone || gProcessingEvents)
{
if(WaitNextEvent ( everyEvent, &gEvent, sleepTime, NULL) )
{
...
}
}
...
}

At 8:15 AM -0500 2/20/03, michael linden wrote:
Ran some tests with the same code running in all three environments:

To transfer a 9.6 MByte file w/OT using a TCP socket connection:

In OSX, App running carbon mode under OSX: 30 seconds
In OSX, App running under classic mode, under OSX: 30 seconds
In System 9.2.2 classic mode (no OSX running): 220 seconds
(when it didn't time out)

Anyone with any ideas on what might be happening?

The code is from the PowerPlant class for networking using OT, and it
appears to be running in async mode.

Again, thanks in advance...


From: michael linden <email@hidden>
Date: Wed, 19 Feb 2003 10:48:56 -0500
To: Mac networking Mail List <email@hidden>
Subject: Open Transport file transfers

Anyone,

Can anyone point me in the right direction as to where I can find out how to
speed large file downloads with OT running in Classic.

The carbon Application transfers large files fine in OSX with OT, but when
running in Classic it is extremely slow, with long pauses and often times
out with a time out of 1 minute set. Same code running in both environments.

Thanks in advance...

Mike Linden
_______________________________________________
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.
_______________________________________________
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.


--
----------------------------------------------------------------
Matt Mashyna email@hidden
The Frodis Co. 814.451.0660
http://www.frodis.com
_______________________________________________
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:
    • FW: Open Transport file transfers
      • From: michael linden <email@hidden>
References: 
 >Re: Open Transport file transfers (From: michael linden <email@hidden>)

  • Prev by Date: Re: Open Transport file transfers
  • Next by Date: FW: Open Transport file transfers
  • Previous by thread: Re: Open Transport file transfers
  • Next by thread: FW: Open Transport file transfers
  • Index(es):
    • Date
    • Thread