Click here to Skip to main content
15,884,388 members
Home / Discussions / C#
   

C#

 
AnswerRe: .Net Remoting with multiple NICs Pin
HaBiX11-Nov-12 22:21
HaBiX11-Nov-12 22:21 
GeneralRe: .Net Remoting with multiple NICs Pin
Mehdi_S25-Nov-12 23:51
Mehdi_S25-Nov-12 23:51 
GeneralRe: .Net Remoting with multiple NICs Pin
HaBiX26-Nov-12 21:26
HaBiX26-Nov-12 21:26 
GeneralRe: .Net Remoting with multiple NICs Pin
Mehdi_S29-Nov-12 9:24
Mehdi_S29-Nov-12 9:24 
QuestionAny latest good books or tutorial on WPF-MVVM ? Pin
Vijay Kanda11-Nov-12 19:19
Vijay Kanda11-Nov-12 19:19 
AnswerRe: Any latest good books or tutorial on WPF-MVVM ? Pin
Abhinav S11-Nov-12 19:43
Abhinav S11-Nov-12 19:43 
GeneralRe: Any latest good books or tutorial on WPF-MVVM ? Pin
Vijay Kanda11-Nov-12 20:32
Vijay Kanda11-Nov-12 20:32 
QuestionThe input stream is not a valid binary format. Pin
RB@Emphasys11-Nov-12 18:53
RB@Emphasys11-Nov-12 18:53 
Alright, I'll admit, after days of looking at this code I'm a bit at my wits end. At a high level it's a project that uses a client server architecture to deliver a stream object via wcf for large data transfers. The blog and project I've utilized can be found here:
http://blogs.msdn.com/b/webapps/archive/2012/09/06/custom-wcf-streaming.aspx[^]

My issue is this, the project works incredibly well with numeric values. But, if I add a few basic string values in, it'll process say 30 rows of data and then die, with the following message:

"The input stream is not a valid binary format. The starting contents (in bytes) are: 08-02-00-00-00-0A-00-00-00-0A-00-00-00-0A-00-00-00 ...

A summarized version of the code looks like this:

Server:

C#
model.ID = i;
model.ParameterOne = i;
model.ParameterTwo = i;
model.ParameterThree = i;
model.AMP = stringCache[i - 1];

formatter.Serialize(memStream, model);


Client:
C#
OrderModel m;
while (s.CanRead)
{
   m = formatter.Deserialize(s) as OrderModel;
   count++;
   Console.Write(string.Format("order ID is {0}\r\n", m.ID));
}



I've run through multiple scenarios. I thought the wcf client was either timing out or being overloaded, but I can run it without wcf all in the same class and run into the same exact issue. I can also manually read and write to a memory stream not utilizing the server class and it works perfectly fine, so that proves it can't be encoding or issues with that data in general.

You can download the same project here (just three classes):
https://skydrive.live.com/redir.aspx?cid=8df0b4ca8325874a&page=self&resid=8DF0B4CA8325874A%21175&parid=8DF0B4CA8325874A%21110&authkey=%21&Bpub=SDX.SkyDrive&Bsrc=Share[^]

If you go to class DBRowStream and comment line 179, it works beautifully. If you uncomment it, it fails after 30 rows. My best guess is that the overriden read method of the class is killing the stream prematurely, but if that were the case, why would a few extra string values mean the difference between it working and not.

I apologize for the novel, and any suggestions or help would be so greatly appreciated!

Thanks so much,
Ryan
GeneralRe: The input stream is not a valid binary format. Pin
Eddy Vluggen12-Nov-12 0:56
professionalEddy Vluggen12-Nov-12 0:56 
GeneralRe: The input stream is not a valid binary format. Pin
RB@Emphasys12-Nov-12 1:42
RB@Emphasys12-Nov-12 1:42 
AnswerRe: The input stream is not a valid binary format. Pin
Ennis Ray Lynch, Jr.12-Nov-12 6:44
Ennis Ray Lynch, Jr.12-Nov-12 6:44 
QuestionApp.Config Pin
Aduu11-Nov-12 13:52
Aduu11-Nov-12 13:52 
QuestionRe: App.Config Pin
Super Lloyd11-Nov-12 16:23
Super Lloyd11-Nov-12 16:23 
AnswerRe: App.Config Pin
ZurdoDev12-Nov-12 5:30
professionalZurdoDev12-Nov-12 5:30 
AnswerRe: App.Config Pin
Simon_Whale12-Nov-12 5:49
Simon_Whale12-Nov-12 5:49 
Questionis Windows-8 can run Webservice that work with FrameWork3.5? Pin
goldsoft11-Nov-12 9:08
goldsoft11-Nov-12 9:08 
AnswerRe: is Windows-8 can run Webservice that work with FrameWork3.5? Pin
Eddy Vluggen11-Nov-12 11:17
professionalEddy Vluggen11-Nov-12 11:17 
Questionselection of similar words in textbox c# Pin
MOR8911-Nov-12 6:26
MOR8911-Nov-12 6:26 
AnswerRe: selection of similar words in textbox c# Pin
Dave Kreskowiak11-Nov-12 7:09
mveDave Kreskowiak11-Nov-12 7:09 
GeneralRe: selection of similar words in textbox c# Pin
MOR8912-Nov-12 4:39
MOR8912-Nov-12 4:39 
GeneralRe: selection of similar words in textbox c# Pin
Dave Kreskowiak12-Nov-12 4:50
mveDave Kreskowiak12-Nov-12 4:50 
QuestionXML Serialization with large objects Pin
Kishore Hyd10-Nov-12 12:31
Kishore Hyd10-Nov-12 12:31 
AnswerRe: XML Serialization with large objects Pin
Eddy Vluggen10-Nov-12 23:35
professionalEddy Vluggen10-Nov-12 23:35 
QuestionInheritance of an Abstract Class Pin
ASPnoob10-Nov-12 10:45
ASPnoob10-Nov-12 10:45 
AnswerRe: Inheritance of an Abstract Class Pin
Mycroft Holmes10-Nov-12 13:21
professionalMycroft Holmes10-Nov-12 13:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.