// ServeTCPConn runs on a single tcp connection. ServeTCPConn blocks, serving
// the connection until the client hangs up. The caller typically invokes
// ServeTCPConn in a go statement.
ServeTCPConn runs on a single tcp connection. ServeTCPConn blocks, serving
the connection until the client hangs up. The caller typically invokes
ServeTCPConn in a go statement.
// ServeTCPConn runs on a single tcp connection . ServeTCPConn blocks serving // the connection until the client hangs up . The caller typically invokes // ServeTCPConn in a go statement .
func (service *TCPService) ServeTCPConn(conn *net.TCPConn) {
	conn.SetLinger(service.Linger)
	conn.SetNoDelay(service.NoDelay)
	conn.SetKeepAlive(service.KeepAlive)
	if service.KeepAlivePeriod > 0 {
		conn.SetKeepAlivePeriod(service.KeepAlivePeriod)
	}
	if service.TLSConfig != nil {
		tlsConn := tls.Server(conn, service.TLSConfig)
		tlsConn.Handshake()
		service.serveConn(tlsConn)
	} else {
		service.serveConn(conn)
	}
}
func ( service * TCPService ) ServeTCPConn ( conn * net . TCPConn ) { conn . SetLinger ( service . Linger ) conn . SetNoDelay ( service . NoDelay ) conn . SetKeepAlive ( service . KeepAlive ) if service . KeepAlivePeriod > 0 { conn . SetKeepAlivePeriod ( service . KeepAlivePeriod ) } if service . TLSConfig != nil { tlsConn := tls . Server ( conn , service . TLSConfig ) tlsConn . Handshake ( ) service . serveConn ( tlsConn ) } else { service . serveConn ( conn ) } }
ServeTCPConn runs on a single tcp connection.
ServeTCPConn runs on a single tcp connection .