Please sign in to comment.
Add sendto/4 and bind/2
sendto/4 takes as arguments: * the socket descriptor * the buffer to be sent * flags * a binary representing a struct sockaddr_* For example, to send an ICMP echo to 192.168.100.1, assuming the variable "Packet" holds a valid ICMP packet: ok = procket:sendto(S, Packet, 0, << 2:16/native, % sin_family: PF_INET 0:16, % sin_port 192:8, 168:8, 100:8, 1:8, % sin_addr 0:64 % sin_zero >> ). Similarly, bind/2 takes: * the socket descriptor * a binary representing a struct sockaddr_*
- Loading branch information...
Showing with 35 additions and 30 deletions.