UDP Question...

Started by
12 comments, last by Miraj 24 years ago
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
-Miraj
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
Volition, Inc.
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
Derek Licciardi (Kressilac)Elysian Productions Inc.
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
-Miraj

This topic is closed to new replies.

Advertisement