本文整理匯總了Golang中github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/gorilla/websocket.Conn.RemoteAddr方法的典型用法代碼示例。如果您正苦於以下問題:Golang Conn.RemoteAddr方法的具體用法?Golang Conn.RemoteAddr怎麽用?Golang Conn.RemoteAddr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/gorilla/websocket.Conn
的用法示例。
在下文中一共展示了Conn.RemoteAddr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewWSConnection
// new websocket connection wrapper
func NewWSConnection(wsConn *websocket.Conn) *WSConnection {
return &WSConnection{
id: wsConn.RemoteAddr().String(),
wsConn: wsConn,
writeChan: make(chan WSResponse, WriteChanBufferSize), // buffered. we keep track when its full
quitChan: make(chan struct{}),
}
}
示例2: NewWSConnection
// new websocket connection wrapper
func NewWSConnection(baseConn *websocket.Conn, funcMap map[string]*RPCFunc, evsw *events.EventSwitch) *WSConnection {
wsc := &WSConnection{
id: baseConn.RemoteAddr().String(),
baseConn: baseConn,
writeChan: make(chan RPCResponse, writeChanCapacity), // error when full.
funcMap: funcMap,
evsw: evsw,
}
wsc.QuitService = *NewQuitService(log, "WSConnection", wsc)
return wsc
}