Click here to Skip to main content
15,917,565 members
Home / Discussions / C#
   

C#

 
AnswerRe: Phone Pin
Not Active18-Jun-09 13:15
mentorNot Active18-Jun-09 13:15 
JokeRe: Phone Pin
musefan18-Jun-09 22:01
musefan18-Jun-09 22:01 
AnswerRe: Phone Pin
Christian Graus18-Jun-09 19:30
protectorChristian Graus18-Jun-09 19:30 
GeneralRe: Phone Pin
EliottA19-Jun-09 2:53
EliottA19-Jun-09 2:53 
QuestionC++ in C# Pin
Omar Gameel Salem18-Jun-09 10:11
professionalOmar Gameel Salem18-Jun-09 10:11 
AnswerRe: C++ in C# Pin
DaveyM6918-Jun-09 10:25
professionalDaveyM6918-Jun-09 10:25 
AnswerRe: C++ in C# Pin
Simon P Stevens18-Jun-09 10:28
Simon P Stevens18-Jun-09 10:28 
AnswerRe: C++ in C# Pin
Dan Neely18-Jun-09 11:05
Dan Neely18-Jun-09 11:05 
AnswerRe: C++ in C# Pin
Omar Gameel Salem18-Jun-09 11:14
professionalOmar Gameel Salem18-Jun-09 11:14 
QuestionC# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 8:15
parth_patel18-Jun-09 8:15 
AnswerRe: C# windowless application for screen capture and replay Pin
Henry Minute18-Jun-09 8:40
Henry Minute18-Jun-09 8:40 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 8:49
parth_patel18-Jun-09 8:49 
AnswerRe: C# windowless application for screen capture and replay Pin
DaveyM6918-Jun-09 8:41
professionalDaveyM6918-Jun-09 8:41 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 8:47
parth_patel18-Jun-09 8:47 
GeneralRe: C# windowless application for screen capture and replay Pin
DaveyM6918-Jun-09 8:56
professionalDaveyM6918-Jun-09 8:56 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 14:00
parth_patel18-Jun-09 14:00 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 14:12
parth_patel18-Jun-09 14:12 
GeneralRe: C# windowless application for screen capture and replay Pin
Dan Neely18-Jun-09 9:17
Dan Neely18-Jun-09 9:17 
GeneralRe: C# windowless application for screen capture and replay Pin
parth_patel18-Jun-09 14:01
parth_patel18-Jun-09 14:01 
Questionc# crypto client/server problem Pin
Kraoc18-Jun-09 5:51
Kraoc18-Jun-09 5:51 
GeneralRe: c# crypto client/server problem Pin
harold aptroot18-Jun-09 6:40
harold aptroot18-Jun-09 6:40 
GeneralRe: c# crypto client/server problem Pin
Kraoc19-Jun-09 0:57
Kraoc19-Jun-09 0:57 
AnswerRe: c# crypto client/server problem Pin
OriginalGriff18-Jun-09 8:21
mveOriginalGriff18-Jun-09 8:21 
GeneralRe: c# crypto client/server problem [modified] Pin
Kraoc19-Jun-09 1:00
Kraoc19-Jun-09 1:00 
AnswerRe: c# crypto client/server problem [modified] Pin
Kraoc19-Jun-09 2:20
Kraoc19-Jun-09 2:20 
It seems that there's a known bug with the .Net framework when trying to serialize in a CryptoStream attached to a NetworkStream.

A bug has been discovered in the .NET library.
It is not possible to serialize to a CryptoStream that is attached to a NetworkStream because the Deserialize call on the receiving end of the stream will block until the stream is closed by the sending end.
You might note that all the MSDN examples use a backing MemoryStream, so perhaps this behavior is expected, but not documented.

A simple rule to avoid this problem is: never attach a CryptoStream to a NetworkStream. We sketch a possible implementation strategy:

* Use a CryptoStream attached to a MemoryStream.
You can serialize objects to this structure, then safely close the stream.
Then, get the byte array from the MemoryStream and write (or serialize, if part of a larger object) it to the NetworkStream. On the receiving side, reverse this process: recover the byte array, decrypt the bytes, then deserialize the result. 


A working exemple is given here using this method:
http://www.marcclifton.com/Default.aspx?tabid=138[^]

Nous ne sommes que des grains de sable mais nous sommes ensemble. Nous sommes comme les grains de sable sur la plage, mais sans les grains de sable la plage n’existerait pas.
Poème en langue yamato(japonais ancien)

modified on Sunday, June 21, 2009 4:06 PM

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.