Muhammad Suleman
Muhammad Suleman

Reputation: 797

What does socket.IPPROTO_TCP do?

Level: beginner! I am trying to create a RAW socket.

s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)

AF_INET=Address Family is internet protocol

Socket type= RAW!

What does the 3rd argument exactly mean?

Upvotes: 0

Views: 5955

Answers (1)

Seema Kadavan
Seema Kadavan

Reputation: 2648

The third argument is for specifying the protocol to be used. IPPROTO_TCP is for using TCP protocol. Refer the link given below for an simple-entry level tutorial

http://www.tutorialspoint.com/unix_sockets/what_is_socket.htm

Upvotes: 2

Related Questions