Connector Performance and Overhead

Which of these two socket connectivity options is more efficient to use in terms of better performance and lower overhead?

socket_connect family or fsockopen ?

+3
source share
1 answer

As far as I know, the performance is very similar, but the connection result is different after initialization. For example, it fsockopen()will open a connection and immediately go to LISTENING-state, where socket_create()it will simply create a connection and socket_open()place it in LISTENING-state.

You can say: fsockopen() === socket_open(socket_create(), ADDRESS)

, , socket_shutdown() socket_close(), TIME_WAIT -state, , , .

, , , , . , , socket_create(), fsockopen(), .

- , cURL, , .

+2

All Articles