func NewInPort(id int) *InPort {
	return &InPort{
		id:      id,
		state:   state{},
		channel: make(chan interface{}),
	}
}
create a new in port instance
package port
import (
	"github.com/DSiSc/craft/log"
	"sync"
)
const (
	LocalInPortId   = 0  
	RemoteInPortId  = 1  
	LocalOutPortId  = 0  
	RemoteOutPortId = 1  
)
type state struct {
	InCount  uint
	OutCount uint
}
type InPort struct {
	id      int
	state   state
	channel chan interface{}
}