Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / April 2007

Tip: Looking for answers? Try searching our database.

Help! What is the maximum size of a byte array that can be returned over remoting?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nanker - 10 Apr 2007 15:09 GMT
I'm working with a .NET application that uses remoting to communicate
between the web layer and an application layer, and one method returns
a byte array containing the contents of a file. The file sizes have
been up to 40 MB previously, and were returned with now problem.
However, now there are some 70 MB files, and whenever a byte array
containing the contents of one of these 70 MB files is returned, the
web layer client gets a Socket exception stating:

   An operation on a socket could not be performed because the system
lacked sufficient buffer space or because a queue was full.

with the following Server stack trace:

  at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32
offset, Int32 size, AsyncCallback callback, Object state)
  at System.Net.Connection.BeginRead(Byte[] buffer, Int32 offset,
Int32 size, AsyncCallback callback, Object state)
  at System.Net.ConnectStream.InternalBeginRead(Int32 bytesToRead,
NestedSingleAsyncResult castedAsyncResult, Boolean fromCallback)
  at System.Net.ConnectStream.BeginReadWithoutValidation(Byte[]
buffer, Int32 offset, Int32 size, AsyncCallback callback, Object
state)
  at System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset,
Int32 size, AsyncCallback callback, Object state)
  at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32
size)
  at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32
count)
  at System.IO.BinaryReader.ReadBytes(Int32 count)
  at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArrayAsBytes(ParseRecord
pr)
  at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum
binaryHeaderEnum)
  at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
  at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
  at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
  at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryResponseMessage(Stream
inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
  at
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage
msg)

This would lead me to believe that this is an issue with the size of
the byte array that is being returned. I've done some digging to try
to find out where/if the maximum object size returned over a remoting
boundary is defined, but I haven't been successful.

- Is there a maximum size of a return value for a remoting interface?
- This is existing legacy code, but is there a better approach to
getting this file content to the web layer? Due to security/network
restrictions, the web layer servers do not have direct access to the
file system where these files are stored.

Thanks in advance
Bryan Phillips - 11 Apr 2007 03:29 GMT
I don't know the exact size, but I break up files into 64 KB chunks
before transferring them.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com
Web Site:  http://www.composablesystems.net

> I'm working with a .NET application that uses remoting to communicate
> between the web layer and an application layer, and one method returns
[quoted text clipped - 60 lines]
>
> Thanks in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.