Results 1 to 1 of 1

Thread: [RESOLVED] Winsock Server/Client two way communication

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326

    Resolved [RESOLVED] Winsock Server/Client two way communication

    Ok so I've read a ton of tutorials on Winsock and can't wrap my brain around this. What I'm trying to do is create a client server arrangement such that a client connects to the server and sends data to it. Once the server gets that data it sends data back over the same connection.

    I want this connection to be used to transmit data in both directions because my client program may be behind a firewall or NAT router and needs to be the one to establish the connection. If the server tries to connect back to the client the connection will fail. Incoming unsolicited connections get dropped.

    Where I'm at right now is; the client is able to connect to the server and send it a string of data, such as, "Hello?" The server is able to receieve and process this data. However, I can't figure out how to get the server to transmit a message back to the client, such as, "Who's there?". The message from the server needs to go back out over this same connection and not a new one.

    Can anyone show me some basic code or point me to a good tutorial?


    Resolved - I put the server's SendData method in the wrong spot
    Last edited by Chris H; Oct 3rd, 2006 at 06:26 PM.
    VB.NET 2005 Express with .Net 2.0
    C# 2010 .Net 4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width