network programming - Can I create a listening TCP socket using raw sockets in Linux? -


i create listening tcp socket control when responds client first syn+ack after receives initial syn packet client.

i want introduce delays or ignore initial syn packets. can using iptables @ moment, i'm wondering if done using os socket interface.

note if use normal tcp socket, once server calls listen() on socket descriptor, os establish connection when client connects it.

i wondering if use raw sockets implement behavior. examples have seen far raw sockets active sockets (client server) , not passive sockets (listening sockets).

you theoretically write own tcp implementation on raw sockets. kernel still respond incoming tcp packets before raw socket gets copy. you'd have work around using iptables or block kernel seeing packets you're interested in.

i think easier in kernel module via netfilter interface (which may you're doing). check out libnetfilter_queue might work if want in userspace.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -