@Synchronized @Throws(IOException::class) fun send(buffer: ByteArray?, offset: Int, len: Int): Int { if (m_state !== PseudoTcpState.TCP_ESTABLISHED) { throw IOException("Socket not connected") } val available_space: Long available_space = m_sbuf.getWriteRemaining() if (available_space == 0L) { m_bWriteEnable = true return 0 } val written: Int = queue(buffer, offset, len, false) attemptSend(SendFlags.sfNone) return written }
Enqueues data in the send buffer