Example #1
0
func CreateQuicDispatcher(writer *ServerWriter, createQuicServerSession func() IncomingDataStreamCreator, taskRunner *TaskRunner, cryptoConfig *ServerCryptoConfig) *QuicDispatcher {
	dispatcher := &QuicDispatcher{
		quicServerSessions:      make(map[*QuicServerSession]bool),
		TaskRunner:              taskRunner,
		createQuicServerSession: createQuicServerSession,
	}

	dispatcher.quicDispatcher = C.create_quic_dispatcher(unsafe.Pointer(writer), unsafe.Pointer(dispatcher), unsafe.Pointer(taskRunner), cryptoConfig.serverCryptoConfig)
	return dispatcher
}
Example #2
0
func CreateQuicDispatcher(writer *ServerWriter, createQuicServerSession func() DataStreamCreator, taskRunner *TaskRunner, proofSource ProofSource, isSecure bool) *QuicDispatcher {
	dispatcher := &QuicDispatcher{
		quicServerSessions:      make(map[*QuicServerSession]bool),
		TaskRunner:              taskRunner,
		createQuicServerSession: createQuicServerSession,
		proofSource:             proofSource,
		isSecure:                isSecure,
	}

	dispatcher.quicDispatcher = C.create_quic_dispatcher(unsafe.Pointer(writer), unsafe.Pointer(dispatcher), unsafe.Pointer(taskRunner))
	return dispatcher
}