This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/hex" | |
"log" | |
"github.com/marten-seemann/qpack" | |
) | |
func DecodeQPack() error { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"flag" | |
"fmt" | |
"log" | |
"github.com/miekg/dns" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"log" | |
"net" | |
"net/http" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
04131ba73eb7a293a48788bb08d8fe1a18f0ab5d0169e852779fd669240c03ed4d5c0b8b1a2c73a639c7f541b82d663dcf6a27870a201b152328de146eec67b150;shijiayun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's see Mr Sustrik's masterpiece | |
// He must like hierarchy and cleanness to death. | |
// So he defined an empty struct of nn_pipe to represent a | |
// concept of connection. | |
// I've known this trick for a while and never thought it could | |
// be used like this | |
// Sean at Shaanxi | |
// 20140901 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last edit: 20140822 15:11 | |
本文分析的代码是 nanomsg-0.4-beta版本。 | |
要创建一个 PUB/SUB 服务,只需要六个 API,分别是: | |
1. nn_socket | |
2. nn_bind | |
3. nn_connect | |
4. nn_send | |
5. nn_recv | |
6. nn_close |