• 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: HTTP server with NetSocket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP server with NetSocket


  • Subject: Re: HTTP server with NetSocket
  • From: Pierre Chatel <email@hidden>
  • Date: Wed, 18 May 2005 16:48:44 -0300


On 18 mai 05, at 12:18, Cameron Hayne wrote:

On 18-May-05, at 11:37 AM, Pierre Chatel wrote:


following my post asking for a lightweight embeddable http server, thanks for all the answer btw :-), i decided to implement it myself using NetSocket.
It's working pretty well for the rss/xml part, but i need to make file transfers with the http/1.0 protocol. It's working for very small files. But all others are truncated. The biggest chunk of data i managed to download was 60~80Kb


What is in the files that you are transferring? If they are binary files, maybe you are having troubles due to zero-value bytes in the files. I'm not sure if NSString will handle embedded nulls.

In fact, only the header is stored in a NSString. I load the file data in an NSData object, then i write the header from the string and the data from the NSData:

[inNetSocket writeData:[aResponse data]]; //header from NSString
[inNetSocket writeData:[response attachementData]]; //file data from NSData

I tested the length of the Data object, it as the same byte number as the HD file. So it was correctly loaded. The pb either come from the NetSocket library or from my HTTP response.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >HTTP server with NetSocket (From: Pierre Chatel <email@hidden>)
 >Re: HTTP server with NetSocket (From: Cameron Hayne <email@hidden>)

  • Prev by Date: Re: Figuring out which values are selected in an NSTableView
  • Next by Date: Re: NEWBIE: Why use protocols?
  • Previous by thread: Re: HTTP server with NetSocket
  • Next by thread: Re: HTTP server with NetSocket
  • Index(es):
    • Date
    • Thread