Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading from a Socket's InputStream



Cameron,

The content that is being exchanged from client to server is textual


I don't see how it would cause the problems you have described (in your post to the Apple java-dev mailing list), but the fact that it is textual data makes me think that perhaps you are running into the usual issue regarding differing line-endings on Windows and Unix systems. That of course means that the same text passage has a different number of bytes on the two systems.


I initially thought that the conversion of the data from text to bytes was the problem. (In fact, my initial implementation was using base64 transfer encoding and the whole shebang.) But I'm currently converting my content data to a byte[] and then writing those bytes as a single call to the OutputStream's write() method. As on the reading side -- I get the Content-Length, create a properly sized byte[], then do a single read on the socket's InputStream's read() method. But the problem still persists.

You mention that you encountered a problem with the client or server running on a Mac - what about if it is running on a Linux system?


I don't have a Linux development environment set up.

I also mention that the Apache "Jakarta" project has some nice HTTP modules that could prove useful. I use their httpclient and fileupload modules.


Thanks for the reference to that work.

- Sparky

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Reading from a Socket's InputStream (From: Bob Krause <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.