Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
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.

GeneralRe: Sockets problem Pin
AnonymousTwo20-May-05 10:11
AnonymousTwo20-May-05 10:11 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 10:55
John Fisher20-May-05 10:55 
GeneralRe: Sockets problem Pin
AnonymousTwo20-May-05 11:24
AnonymousTwo20-May-05 11:24 
GeneralRe: Sockets problem Pin
John Fisher20-May-05 19:19
John Fisher20-May-05 19:19 
Generalprob with activex Pin
amalatsliit20-May-05 7:10
amalatsliit20-May-05 7:10 
GeneralDataBinding Format/Parse Event, can't raise the Parse Event Pin
Kaneda7920-May-05 5:48
Kaneda7920-May-05 5:48 
QuestionHow to register Hotkey for TextBox? Pin
oohungoo20-May-05 5:47
oohungoo20-May-05 5:47 
AnswerRe: How to register Hotkey for TextBox? Pin
Marc Clifton20-May-05 6:35
mvaMarc Clifton20-May-05 6:35 
GeneralPicturebox and tiff file Pin
Anonymous20-May-05 4:43
Anonymous20-May-05 4:43 
GeneralRe: Picturebox and tiff file Pin
Robert Rohde20-May-05 6:04
Robert Rohde20-May-05 6:04 
GeneralNetwork Utlization Pin
Zishan Haider20-May-05 4:05
Zishan Haider20-May-05 4:05 
GeneralNice Class and Method Descriptions Pin
zandries20-May-05 3:56
zandries20-May-05 3:56 
GeneralRe: Nice Class and Method Descriptions Pin
Judah Gabriel Himango20-May-05 4:28
sponsorJudah Gabriel Himango20-May-05 4:28 
GeneralRe: Nice Class and Method Descriptions Pin
zandries20-May-05 4:40
zandries20-May-05 4:40 
GeneralRe: Nice Class and Method Descriptions Pin
Anonymous20-May-05 4:46
Anonymous20-May-05 4:46 
GeneralRe: Nice Class and Method Descriptions Pin
MoustafaS20-May-05 14:39
MoustafaS20-May-05 14:39 
GeneralLogPag Pin
albCode20-May-05 1:46
albCode20-May-05 1:46 

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.