HighTechTalks DotNet Forums  

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

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Help! What is the maximum size of a byte array that can be returned over remoting? in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nanker
 
Posts: n/a

Default Help! What is the maximum size of a byte array that can be returned over remoting? - 04-10-2007 , 10:09 AM






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.BeginReadWithoutValidatio n(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.__B inaryParser.ReadArrayAsBytes(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.ReadArray(BinaryHeaderEnum
binaryHeaderEnum)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.Obj ectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.Deser ializeBinaryResponseMessage(Stream
inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
at
System.Runtime.Remoting.Channels.BinaryClientForma tterSink.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


Reply With Quote
  #2  
Old   
Bryan Phillips
 
Posts: n/a

Default Re: Help! What is the maximum size of a byte array that can be returned over remoting? - 04-10-2007 , 10:29 PM






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



"Nanker" <nanker (AT) sacbeemail (DOT) com> wrote


Quote:
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.BeginReadWithoutValidatio n(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.__B inaryParser.ReadArrayAsBytes(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.ReadArray(BinaryHeaderEnum
binaryHeaderEnum)
at
System.Runtime.Serialization.Formatters.Binary.__B inaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.Obj ectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.Deser ializeBinaryResponseMessage(Stream
inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
at
System.Runtime.Remoting.Channels.BinaryClientForma tterSink.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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.