File: connection_context.rb

package info (click to toggle)
ruby-protocol-http2 0.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 472 kB
  • sloc: ruby: 3,627; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.

require "protocol/http2/client"
require "protocol/http2/server"
require "protocol/http2/stream"

require "socket"

module Protocol
	module HTTP2
		ConnectionContext = Sus::Shared("a connection") do
			let(:sockets) {Socket.pair(Socket::PF_UNIX, Socket::SOCK_STREAM)}
			
			let(:client) {Protocol::HTTP2::Client.new(Protocol::HTTP2::Framer.new(sockets.first))}
			let(:server) {Protocol::HTTP2::Server.new(Protocol::HTTP2::Framer.new(sockets.last))}
		end
	end
end