QuestionQ65

VerifiedNetwork Interfaces

What does this line of code do?

example=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

Explanation

socket.AF_INET selects IPv4 addressing and socket.SOCK_DGRAM selects a datagram socket, which is UDP. The statement creates a UDP socket that can subsequently transmit or receive data.

Community Discussion

No comments yet. Be the first to start the discussion!