Documentation
¶
Index ¶
- Constants
- Variables
- func DelAllCacheContainer()
- func DelCacheContainer(key string)
- func GetCacheContainer(key string) *cacheContainer
- func GetClientInfoByConn(conn net.Conn, cb_ok func(*ClientInfo), cb_fail func())
- func GetClientInfoByName(ServerName string, cb_ok func(*ClientInfo), cb_fail func())
- func GetId(name string) string
- func GetOnlineServiceNumByName(userName string) int
- func GetOnlineServiceNumByNameAndIP(userName, ip string) int
- func GetServerInfoByConn(conn net.Conn, cb_ok func(*ClientInfo), cb_fail func())
- func HashPasswd(pass string) string
- func Id_test(name string)
- func Md5(msg string) string
- func Read(conn net.Conn, callback ReadCallBack)
- func RmId(name, id string)
- func Write(conn net.Conn, id string, action string, content string) error
- func Xor(s string) string
- type AdminInfo
- type ClientInfo
- type ClientSetting
- type ReadCallBack
- type ReadUDPCallBack
- type Session
- type UDPMakeSession
Constants ¶
View Source
const Version = 0.70
Variables ¶
View Source
var Conn2Admin map[net.Conn]*AdminInfo
View Source
var Conn2ClientInfo map[net.Conn]*ClientInfo
View Source
var ServerName2Conn map[string]net.Conn
Functions ¶
func DelAllCacheContainer ¶
func DelAllCacheContainer()
func DelCacheContainer ¶
func DelCacheContainer(key string)
func GetCacheContainer ¶
func GetCacheContainer(key string) *cacheContainer
func GetClientInfoByConn ¶
func GetClientInfoByConn(conn net.Conn, cb_ok func(*ClientInfo), cb_fail func())
func GetClientInfoByName ¶
func GetClientInfoByName(ServerName string, cb_ok func(*ClientInfo), cb_fail func())
func GetServerInfoByConn ¶
func GetServerInfoByConn(conn net.Conn, cb_ok func(*ClientInfo), cb_fail func())
func HashPasswd ¶
func Read ¶
func Read(conn net.Conn, callback ReadCallBack)
Types ¶
type ClientInfo ¶
type ClientInfo struct { Conn net.Conn ClientMap map[net.Conn]*Session Id2Session map[string]*Session UserName string ClientKey string ResponseTime int64 Quit chan bool IsServer bool ServerName string // is serverName != "", this client is a server! Id2MakeSession map[string]*UDPMakeSession }
func (*ClientInfo) AddClient ¶
func (s *ClientInfo) AddClient(conn net.Conn, clientInfo ClientSetting)
func (*ClientInfo) GetSession ¶
func (s *ClientInfo) GetSession(conn net.Conn) *Session
func (*ClientInfo) Loop ¶
func (s *ClientInfo) Loop()
type ClientSetting ¶
type ReadUDPCallBack ¶
type Session ¶
type Session struct { Id string ClientA net.Conn ClientB net.Conn Status string OverTime int64 Method string Setting ClientSetting MakeHoleResponseN int MakeHoleHasFail bool Quit chan bool }
func (*Session) RestartSession ¶
func (*Session) StartCSMode ¶
func (session *Session) StartCSMode()
func (*Session) StartSession ¶
type UDPMakeSession ¶
type UDPMakeSession struct { Id string CreateTime int64 ClientA net.Conn ClientB net.Conn SessionId string PipeType string Status string ServerName string Quit chan bool }
func (*UDPMakeSession) BeginMakeHole ¶
func (udpsession *UDPMakeSession) BeginMakeHole(step int, content string)
func (*UDPMakeSession) Loop ¶
func (udpsession *UDPMakeSession) Loop()
func (*UDPMakeSession) Remove ¶
func (udpsession *UDPMakeSession) Remove(bTimeout bool)
Click to show internal directories.
Click to hide internal directories.