This commit is contained in:
V2Ray
2015-10-11 14:46:12 +02:00
parent 2a85c62e14
commit 702aaacac3
4 changed files with 23 additions and 0 deletions
+2
View File
@@ -4,12 +4,14 @@ import (
"github.com/v2ray/v2ray-core/common/alloc"
)
// Packet is a network packet to be sent to destination.
type Packet interface {
Destination() Destination
Chunk() *alloc.Buffer // First chunk of this commnunication
MoreChunks() bool
}
// NewPacket creates a new Packet with given destination and payload.
func NewPacket(dest Destination, firstChunk *alloc.Buffer, moreChunks bool) Packet {
return &packetImpl{
dest: dest,