Tutorial by Examples

UDP is a connectionless protocol. Messages to other processes or computers are sent without establishing any sort of connection. There is no automatic confirmation if your message has been received. UDP is usually used in latency sensitive applications or in applications sending network wide broadca...
UDP is a connectionless protocol. This means that peers sending messages do not require establishing a connection before sending messages. socket.recvfromthus returns a tuple (msg [the message the socket received], addr [the address of the sender]) A UDP server using solely the socket module: from...
Sending data over the internet is made possible using multiple modules. The sockets module provides low-level access to the underlying Operating System operations responsible for sending or receiving data from other computers or processes. The following code sends the byte string b'Hello' to a TCP ...
When run with no arguments, this program starts a TCP socket server that listens for connections to 127.0.0.1 on port 5000. The server handles each connection in a separate thread. When run with the -c argument, this program connects to the server, reads the client list, and prints it out. The clie...
First you disable your network card's automatic checksumming: sudo ethtool -K eth1 tx off Then send your packet, using a SOCK_RAW socket: #!/usr/bin/env python from socket import socket, AF_PACKET, SOCK_RAW s = socket(AF_PACKET, SOCK_RAW) s.bind(("eth1", 0)) # We're putting toge...

Page 1 of 1