
retrieve the adapters from the computer It wont work on the loopback address tho, it will only see data sent to other computers. If you are unfamiliar with networking perhaps get a copy of Wireshark and sniff some data. If it is a real client/server situation I would strongly advise against using UDP, if you really need this, it is possible to fake the SYN, and SYN ACK packets with pcap. You could set up a connection first, and then send data from pcap (have to use the same source ip and port as well as the same destination ip and port for this to work). This is exactly what a UDP program would do. When pcap (or winpcap for windows) sends a raw packet, it only sends the single data packet, not a connection setup.


This is typically used for things like skype, where you dont want to have to wait for a packet to be resent because that would add a delay into your chat, the video just skips a bit instead. UDP does not have any connection state and hence does not guarantee a successful delivery of data, this is left up to you if you care. You send data to the server IP and port and your server program receives this data. The alternative is User Datagram Protocol (UDP) this is a stateless connection. TCP connections allow for error handling when packets are lost, which makes it a good choice. It should also be shutdown cleanly (this is not absolutly required by the protocol, but should be coded). This requires the client to send a connection request (known as SYN), the server to reply with a connection accepted (known as ACK) and the client to acknowledge the accepted connection (known as a SYN ACK). How is the server set up? I suspect it is with a TCP connection.Ī typical client/server system would use Transmission Control Protocol (TCP).
