pub fn write(&self, data: &[u8]) -> Result<(), Error> {
		match &self.tls_server {
			Some(tls_conn) => {
				let mut wbuf = vec![];
				{
					let mut tls_conn = nioruntime_util::lockw!(tls_conn);
					let mut start = 0;
					loop {
						let mut end = data.len();
						if end - start > TLS_CHUNKS {
							end = start + TLS_CHUNKS;
						}
						tls_conn.writer().write_all(&data[start..end])?;
						tls_conn.write_tls(&mut wbuf)?;
						if end == data.len() {
							break;
						}
						start += TLS_CHUNKS;
					}
				}
				self.do_write(&wbuf)
			}
			None => match &self.tls_client {
				Some(tls_conn) => {
					let mut wbuf = vec![];
					{
						let mut tls_conn = nioruntime_util::lockw!(tls_conn);
						let mut start = 0;
						loop {
							let mut end = data.len();
							if end - start > TLS_CHUNKS {
								end = start + TLS_CHUNKS;
							}
							tls_conn.writer().write_all(&data[start..end])?;
							tls_conn.write_tls(&mut wbuf)?;
							if end == data.len() {
								break;
							}
							start += TLS_CHUNKS;
						}
					}
					self.do_write(&wbuf)
				}
				None => self.do_write(data),
			},
		}
	}
/// Write the specifed data to the connection associated with this write handle.
///
/// * `data` - The data to write to this connection.
Write the specifed data to the connection associated with this write handle.
`data` - The data to write to this connection.
Write the specifed data to the connection associated with this write handle . ` data ` - The data to write to this connection .
pub fn write(&self, data: &[u8]) -> Result<(), Error> {
		match &self.tls_server {
			Some(tls_conn) => {
				let mut wbuf = vec![];
				{
					let mut tls_conn = nioruntime_util::lockw!(tls_conn);
					let mut start = 0;
					loop {
						let mut end = data.len();
						if end - start > TLS_CHUNKS {
							end = start + TLS_CHUNKS;
						}
						tls_conn.writer().write_all(&data[start..end])?;
						tls_conn.write_tls(&mut wbuf)?;
						if end == data.len() {
							break;
						}
						start += TLS_CHUNKS;
					}
				}
				self.do_write(&wbuf)
			}
			None => match &self.tls_client {
				Some(tls_conn) => {
					let mut wbuf = vec![];
					{
						let mut tls_conn = nioruntime_util::lockw!(tls_conn);
						let mut start = 0;
						loop {
							let mut end = data.len();
							if end - start > TLS_CHUNKS {
								end = start + TLS_CHUNKS;
							}
							tls_conn.writer().write_all(&data[start..end])?;
							tls_conn.write_tls(&mut wbuf)?;
							if end == data.len() {
								break;
							}
							start += TLS_CHUNKS;
						}
					}
					self.do_write(&wbuf)
				}
				None => self.do_write(data),
			},
		}
	}
pub fn write ( & self , data : & [ u8 ] ) -> Result < ( ) , Error > { match & self . tls_server { Some ( tls_conn ) => { let mut wbuf = vec ! [ ] ; { let mut tls_conn = nioruntime_util :: lockw ! ( tls_conn ) ; let mut start = 0 ; loop { let mut end = data . len ( ) ; if end - start > TLS_CHUNKS { end = start + TLS_CHUNKS ; } tls_conn . writer ( ) . write_all ( & data [ start .. end ] ) ? ; tls_conn . write_tls ( & mut wbuf ) ? ; if end == data . len ( ) { break ; } start += TLS_CHUNKS ; } } self . do_write ( & wbuf ) } None => match & self . tls_client { Some ( tls_conn ) => { let mut wbuf = vec ! [ ] ; { let mut tls_conn = nioruntime_util :: lockw ! ( tls_conn ) ; let mut start = 0 ; loop { let mut end = data . len ( ) ; if end - start > TLS_CHUNKS { end = start + TLS_CHUNKS ; } tls_conn . writer ( ) . write_all ( & data [ start .. end ] ) ? ; tls_conn . write_tls ( & mut wbuf ) ? ; if end == data . len ( ) { break ; } start += TLS_CHUNKS ; } } self . do_write ( & wbuf ) } None => self . do_write ( data ) , } , } }
Write the specifed data to the connection associated with this write handle.
Write the specifed data to the connection associated with this write handle .
&self
data
&[u8]
&self
data
&[u8]