Problem Statement
In socket programming, which pair of functions are used to establish a TCP connection?
Explanation
In TCP socket programming, a client initiates a connection using connect(), while the server waits for requests using accept(). Once connected, data transfer uses send() and recv(). Understanding this flow helps you answer coding-based interview questions.
Code Solution
SolutionRead Only
Server: socket(), bind(), listen(), accept() Client: socket(), connect()
Practice Sets
This question appears in the following practice sets:
