Quote:
Originariamente inviato da marco.r
No, cdimauro ha detto che _python_ non fa buffering. Poi dipende da quello che fa la libreria C e il sistema operativo.
|
Volevo dire che anche per Java è così.
La libreria fornisce dei precotti per i casi d'uso più comuni.
Ad esempio ci sono java.net.SSLSocket e java.net.SSLServerSocket che poi non sono altro che specializzazioni di java.net.Socket/java.net.ServerSocket per TCP. C'è poi java.net.DatagramSocket per UDP.
le varie classi Socket/DatagramSocket delegano il "vero" lavoro alle astrazioni java.net.SocketImpl e java.net.DatagramSocketImpl: ogni piattaforma fornisce la propria specifica implementazione di queste due classi astratte.
Queste implementazioni platform-specific concretizzano (implementano) l'interfaccia comune e trasversale: java.net.SocketOptions.
E in SocketOprions troviamo opzioni per i socket molto specifiche tra cui alcune significative, tipo: SO_RCVBUF, SO_SNDBUF e TCP_NODELAY.
Queste non sono relative a Java, ma alla piattaforma/sistema su cui gira la vm, ad esempio il javadoc di SO_RCVBUF recita:
Quote:
static final int SO_RCVBUF
Set a hint the size of the underlying buffers used by the platform for incoming network I/O. When used in set, this is a suggestion to the kernel from the application about the size of buffers to use for the data to be received over the socket. When used in get, this must return the size of the buffer actually used by the platform when receiving in data on this socket. Valid for all sockets: SocketImpl, DatagramSocketImpl
|
Qua ho trovato delle
vecchie FAQ (ma sospetto dal contenuto ancora valido) a uso e consumo di demos88