Next:
3.1.7.3 Safe Raw Sockets
Up:
3.1.7 Safe Raw Sockets
Previous:
3.1.7.1 Safe Raw Sockets
3.1.7.2 Safe Raw Sockets - Socket API
Create the TCP raw socket
sock = socket(PF_INET, SOCK_RAW, IPPROTO_TCP);
Bind to a local port
struct sockaddr_in sin;
memset(& sin, 0, sizeof(sin));
sin.sin_port = htons(9090);
bind(sock, (struct sockaddr *)& sin, sizeof(sin));
Send call not supported, sendto, sendmsg, recv, recvfrom, recvmsg and select calls can be used
Next:
3.1.7.3 Safe Raw Sockets
Up:
3.1.7 Safe Raw Sockets
Previous:
3.1.7.1 Safe Raw Sockets
Ian Wakeman 2005-04-22