Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: Resolving &eacute when loading XmlDocument Pin
DavidNohejl24-May-05 10:08
DavidNohejl24-May-05 10:08 
Generalkeyboard Pin
daonlyone20-May-05 10:27
daonlyone20-May-05 10:27 
GeneralRe: keyboard Pin
Nick Parker20-May-05 10:58
protectorNick Parker20-May-05 10:58 
GeneralRe: keyboard Pin
daonlyone21-May-05 12:22
daonlyone21-May-05 12:22 
GeneralDataSet View Pin
samoore20-May-05 9:10
samoore20-May-05 9:10 
GeneralRe: DataSet View Pin
John Fisher20-May-05 9:20
John Fisher20-May-05 9:20 
GeneralRe: DataSet View Pin
rudy.net20-May-05 10:10
rudy.net20-May-05 10:10 
GeneralRe: DataSet View Pin
Luis Alonso Ramos20-May-05 12:50
Luis Alonso Ramos20-May-05 12:50 
GeneralRe: DataSet View Pin
samoore21-May-05 11:21
samoore21-May-05 11:21 
GeneralUser Application folder Pin
JMichael246820-May-05 8:44
JMichael246820-May-05 8:44 
GeneralRe: User Application folder Pin
rudy.net20-May-05 9:00
rudy.net20-May-05 9:00 
GeneralRe: User Application folder Pin
John Fisher20-May-05 9:01
John Fisher20-May-05 9:01 
GeneralRe: User Application folder Pin
JMichael246820-May-05 9:19
JMichael246820-May-05 9:19 
GeneralRe: User Application folder Pin
Rob Graham20-May-05 9:02
Rob Graham20-May-05 9:02 
GeneralCalling C# class library in VC++6.0....... Pin
DasdaDAS20-May-05 7:58
DasdaDAS20-May-05 7:58 
GeneralRe: Calling C# class library in VC++6.0....... Pin
John Fisher20-May-05 9:15
John Fisher20-May-05 9:15 
GeneralRe: Calling C# class library in VC++6.0....... Pin
Nick Parker20-May-05 11:01
protectorNick Parker20-May-05 11:01 
QuestionHow do i make a program run at startup Pin
Anthony Mushrow20-May-05 7:33
professionalAnthony Mushrow20-May-05 7:33 
AnswerRe: How do i make a program run at startup Pin
Anonymous20-May-05 7:58
Anonymous20-May-05 7:58 
GeneralRe: How do i make a program run at startup Pin
Anthony Mushrow20-May-05 8:07
professionalAnthony Mushrow20-May-05 8:07 
GeneralRe: How do i make a program run at startup Pin
John Fisher20-May-05 9:23
John Fisher20-May-05 9:23 
AnswerRe: How do i make a program run at startup Pin
Anonymous20-May-05 12:01
Anonymous20-May-05 12:01 
AnswerRe: How do i make a program run at startup Pin
malharone20-May-05 12:05
malharone20-May-05 12:05 
GeneralSockets problem Pin
AnonymousTwo20-May-05 7:29
AnonymousTwo20-May-05 7:29 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 9:11
John Fisher20-May-05 9:11 
Unless I'm making a horrible mistake in reading your code, the flow goes something like this:

ReceiveCallback is hit, and proceeds through the following lines, in order:
<br />
if (bytesRead > 0)<br />
<br />
  state.gameDataStream.Write(state.buffer, 0, bytesRead);<br />
  receiveDone.Reset();<br />
  client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,<br />
    new AsyncCallback(RecieveCallback), state);<br />
  receiveDone.WaitOne();<br />


The result is that inside your read you start waiting for the next read to finish. So, at least until something triggers receiveDone, the code will not reach your bgForm.RecieveObject(state.gameDataStream) function.

You will need to rework the flow logic, so you can handle the data you just received before waiting for the next read, or triggere then next read and handle your data without waiting for the next read to finish.

John

"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.

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.