Receive vs ReceiveFrom...
-
Hi everyone, I posted this question earlier today but i didn't get a response. I am a mini jam here, so I decided to ask it again. To the people who read my first post, SORRY! I need to look into a UDP buffer but just peek at it. I have read that I can use MSG_PEEK with ReceiveFrom, but can I use it was Receive? I use Receive(,,MSGPEEK) with a TCP implementation and it works perfectly. How would I do this in UDP? Here is what I have;
unsigned int temp; int rVal = Receive(&temp, sizeof(temp), MSG_PEEK); if(rVal < 0) { int err = GetLastError(); } else { unsigned int RecvBuf; int rVal2 = Receive(&RecvBuf, sizeof(RecvBuf)); //No peek! ... }
Any help would be appreciated greatly. If you have code that does this, i would also appreciate that too. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
-
Hi everyone, I posted this question earlier today but i didn't get a response. I am a mini jam here, so I decided to ask it again. To the people who read my first post, SORRY! I need to look into a UDP buffer but just peek at it. I have read that I can use MSG_PEEK with ReceiveFrom, but can I use it was Receive? I use Receive(,,MSGPEEK) with a TCP implementation and it works perfectly. How would I do this in UDP? Here is what I have;
unsigned int temp; int rVal = Receive(&temp, sizeof(temp), MSG_PEEK); if(rVal < 0) { int err = GetLastError(); } else { unsigned int RecvBuf; int rVal2 = Receive(&RecvBuf, sizeof(RecvBuf)); //No peek! ... }
Any help would be appreciated greatly. If you have code that does this, i would also appreciate that too. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
NewHSKid wrote: Just cause I am 15... hmmm... this is a silly slogan, i'm ONLY 17, and i don't use my age for getting pity! use recvfrom for udp, it will return you the peer's address, so you'll know where the data came from! Don't try it, just do it! ;-)
-
NewHSKid wrote: Just cause I am 15... hmmm... this is a silly slogan, i'm ONLY 17, and i don't use my age for getting pity! use recvfrom for udp, it will return you the peer's address, so you'll know where the data came from! Don't try it, just do it! ;-)
No, you don't understand... These days it works in reverse. I'm 41, have a wife, three kids and an ex-wife. I'm the one that needs pity.... :( On the other hand, though, I can often answer questions sensibly in the CP forums, so it ain't all bad... Steve S
-
No, you don't understand... These days it works in reverse. I'm 41, have a wife, three kids and an ex-wife. I'm the one that needs pity.... :( On the other hand, though, I can often answer questions sensibly in the CP forums, so it ain't all bad... Steve S
oh poor steve... it's sooo shattering :( Don't try it, just do it! ;-)
-
oh poor steve... it's sooo shattering :( Don't try it, just do it! ;-)
Who said that was put there for pity? That is really in there so that people DON'T talk down to me and like I am an idiot. I don't believe your comment was necessary, considering that it has nothing to do with pity. Thank you for your help though. I appreciate it. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)