Re: stop Socket.BeginReceive before comlpete



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 TCP
hole 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.

.



Relevant Pages

  • Re: TCP Streams from Unknown source to VB.Net
    ... communicate with any types of other platforms on TCP/IP communication. ... the data structure is sent in binary format out over a socket. ... can't contain arrays. ... from the server. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: REST, SOAP, approaches to web connectivity
    ... whether you are using REST or not there has too be a session server for the ... "something" will have to facilitate communication between these ... clients and your D3 server. ... Now all you need is the communication between the middle (http server ...
    (comp.databases.pick)
  • Re: C sockets
    ... :if no then select is only thing to have server socket program on one ... :pc and other clients on many pcs to have communication with server? ... serving N clients requires at least times the amount of memory ...
    (comp.lang.c)
  • Re: Format of string output of a socket server
    ... a socket can ONLY send bytes. ... What for example does your standard POP3 server send? ... The client program can then convert to Unicode or whatever they see fit? ... I am writing a socket server to deliver telephony events to clients on ...
    (microsoft.public.win32.programmer.networks)
  • Re: Ideas on solving the file transfer problem
    ... Once the clients have negotiated a session they operate ... peer-to-peer and the server never sees the streams. ... Skype still relies on a centralized client- ... "switchboard servers" to "establish lightweight communication sessions ...
    (comp.programming)