Thread: Receive a TCP message on a UDP socket?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

    Receive a TCP message on a UDP socket?

    My program currently opens a UDP socket, and sends out a UDP message with it (naturally). It then receives a UDP message back. All is good. But every now and then, the remote computer will send back some TCP data to me, and completely forget UDP. How should I set up my socket to receive data in either protocol? Also, if I don't know what protocol the incoming data is being sent with, then how do I know if I received all of it? (UDP only sends one message, but TCP will send an unknown multiple amount)
    Last edited by Yarin; 09-04-2009 at 01:30 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. UDP socket no longer works when put in to a class
    By System_159 in forum Networking/Device Communication
    Replies: 0
    Last Post: 04-08-2009, 07:55 AM
  2. UDP and TCP packets on port 6112
    By biosninja in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 01-19-2004, 11:21 AM
  3. udp vs tcp.....
    By djarian in forum Networking/Device Communication
    Replies: 3
    Last Post: 12-15-2003, 11:41 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. TCP client/server problem.
    By WL in forum C Programming
    Replies: 0
    Last Post: 10-15-2001, 12:55 AM