Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Miraj

UDP Question...

This topic is 7000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, one tumor and three days later I think (I THINK) the pieces of the puzzle are finally fitting

Thanks guys for helping out. I seriously couldn''t have done this without the help/snippets. I learned a hell of alot about Winsock, thats for sure.

I wanted to refrain from bothering anyone anymore about this but I do have this one minor glitch that is happening

Is there any possible reason why the client would freeze after recieving a packet? ;( I''ve checked *everything* over and over, numerous times and I just can''t see what would cause it to do that. I have all the nessecary code in order to process the information and don''t get it at all...

-Miraj

Share this post


Link to post
Share on other sites
Advertisement
You might try making sure the socket you're reading-from/writing-to is operating in non-blocking mode. A blocking select or recvfrom() call could be causing this.

Edited by - daveb on 3/21/00 4:29:06 PM

Share this post


Link to post
Share on other sites
Miraj,

While reading this post, I noticed something that you are doing that needs to be addressed. In your linked list implementation you were calling send(... IPEntries...) and in your array implementation you called IPList. I think you need to look into iterating and traversing lists of data structures. Both of these issues in your code were related to traversing the list. Jeff fixed it in his. Take note of how he used a for loop to iterate the array list using the index instead of just passing the pointer to the array thinking it will iterate itself.

To iterate an array use his code.

for (int counter = 0; counter == MAX_COUNTER; counter++) {
Do something using the array[counter].
}

To iterate a linked list use the following if you are sure you will always ready every node.

for (Node *pnode = ListHead; !pnode; pnode = pnode->next) {
Do something for pnode->value.
}

Use a while loop instead of a for loop if you think you will stop iterating midway through the linked list. I hope this helps and sorry to get a listtle off topic there, but figured it needed to be mentioned.

Kressilac

Edited by - kressilac on 3/22/00 9:26:14 AM

Share this post


Link to post
Share on other sites
Daveb, Kressilac,

Thanks for the input guys. I finally got everything working thanks to all the great responses.

Daveb: You were right about the blocking, that was the problem. I set the appropriate flag and it stopped. I don''t know how I overlooked that.

Kressilac: Thanks for pointing that out. I''m really not that experienced with linked lists yet. It seemed like a reasonable solution to what I wanted to do but I was definatly weak on the implementation of it.

Thanks again!






-Miraj

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!