func (s *SessionState) ListenPort() string {
	return s.listenPort
}
ListenPort gets the SessionState listen port
package plugin
import (
	"bytes"
	"crypto/rand"
	"crypto/rsa"
	"encoding/base64"
	"encoding/gob"
	"encoding/json"
	"errors"
	"fmt"
	"os"
	"time"
	log "github.com/sirupsen/logrus"
	"github.com/intelsdi-x/snap/control/plugin/cpolicy"
	"github.com/intelsdi-x/snap/control/plugin/encoding"
	"github.com/intelsdi-x/snap/control/plugin/encrypter"
	"github.com/intelsdi-x/snap/core/cdata"
	"github.com/intelsdi-x/snap/core/ctypes"
)
type SessionState struct {
	*Arg
	*encrypter.Encrypter
	encoding.Encoder
	LastPing time.Time
	plugin        Plugin
	token         string
	listenAddress string
	killChan      chan int
	logger        *log.Logger
	privateKey    *rsa.PrivateKey
	encoder       encoding.Encoder
}
type GetConfigPolicyArgs struct{}
type Session interface {
	Ping([]byte, *[]byte) error
	Kill([]byte, *[]byte) error
	GetConfigPolicy([]byte, *[]byte) error
	Logger() *log.Logger
	ListenAddress() string
	SetListenAddress(string)
	ListenPort() string
	Token() string
	KillChan() chan int
	ResetHeartbeat()
	generateResponse(r *Response) []byte
	heartbeatWatch(killChan chan int)
	isDaemon() bool
	SetKey(SetKeyArgs, *[]byte) error
	setKey([]byte)
	Encode(interface{}) ([]byte, error)
	Decode([]byte, interface{}) error
	DecryptKey([]byte) ([]byte, error)
}
type PingArgs struct{}
func (s *SessionState) GetConfigPolicy(args []byte, reply *[]byte) error {
	defer catchPluginPanic(s.Logger())
	s.logger.Debug("GetConfigPolicy called")
	policy, err := s.plugin.GetConfigPolicy()
	if err != nil {
		return errors.New(fmt.Sprintf("GetConfigPolicy call error : %s", err.Error()))
	}
	r := GetConfigPolicyReply{Policy: policy}
	*reply, err = s.Encode(r)
	if err != nil {
		return err
	}
	return nil
}
func (s *SessionState) Ping(arg []byte, reply *[]byte) error {
	s.ResetHeartbeat()
	s.logger.Debug("Ping received")
	*reply = []byte{}
	return nil
}
func (s *SessionState) Kill(args []byte, reply *[]byte) error {
	a := &KillArgs{}
	err := s.Decode(args, a)
	if err != nil {
		return err
	}
	s.logger.Debugf("Kill called by agent, reason: %s\n", a.Reason)
	go func() {
		time.Sleep(time.Second * 2)
		s.killChan <- 0
	}()
	*reply = []byte{}
	return nil
}
func (s *SessionState) Logger() *log.Logger {
	return s.logger
}
func (s *SessionState) ListenAddress() string {
	return s.listenAddress
}