Re: stop Socket.BeginReceive before comlpete
- From: v-phuang@xxxxxxxxxxxxxxxxxxxx ("Peter Huang" [MSFT])
- Date: Tue, 05 Sep 2006 06:57:13 GMT
Hi Semedao,
Thanks for your information.
So far I still have some confusion.
It seems that you are useing TCP hole punching.
Here is a document for your reference.
Peer-to-Peer Communication Across Network Address Translators
http://www.brynosaurus.com/pub/net/p2pnat/
From the document, it seems that we need two sockets on one port for TCPhole punching.
Also from your description, you will also need the socket to listen to the
Server.(Here I understand you have two clients(doing P2P), and a Server who
coordinate the two clients).
Can you enlaborator how did you listen to the Server? or did you just want
to receive data from Server?
Also based on my knowledge, assume we established the TCP connection
between the two clients without the Server, the following communication
should be between client1 and client2.
e.g.
Assume the Socket serversocket the socket that communicate with client
after listen/accept.
Socket serversocket;
Thread1()
{
serversocket.Receive();//it will block for incoming data.
}
Thread2()
{
serversocket.Send();//based on my test, even if serversocket is blocked on
receive, it still can send data.
}
So I just wonder why you need to interrupte the Thread1 that the
serversocket.Receive?
Can you show some code about you stop the thread1 that call socket.Receive
and use that socket to listen to the Server messge?
If you have any concern, you may send an Email to me via removing "online"
from my email address.
Thanks!
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: stop Socket.BeginReceive before comlpete
- From: semedao
- Re: stop Socket.BeginReceive before comlpete
- References:
- stop Socket.BeginReceive before comlpete
- From: semedao
- Re: stop Socket.BeginReceive before comlpete
- From: semedao
- Re: stop Socket.BeginReceive before comlpete
- From: "Peter Huang" [MSFT]
- Re: stop Socket.BeginReceive before comlpete
- From: semedao
- stop Socket.BeginReceive before comlpete
- Prev by Date: Re: Octal number to int number
- Next by Date: Re: Expressions in C#...
- Previous by thread: Re: stop Socket.BeginReceive before comlpete
- Next by thread: Re: stop Socket.BeginReceive before comlpete
- Index(es):
Relevant Pages
|