Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
e81d7210
Commit
e81d7210
authored
Sep 14, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket: rename websocket.WebSocketAddr to *websocket.Addr.
R=ukai CC=golang-dev
https://golang.org/cl/4999043
parent
33d00fae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/pkg/websocket/websocket.go
src/pkg/websocket/websocket.go
+7
-7
No files found.
src/pkg/websocket/websocket.go
View file @
e81d7210
...
...
@@ -57,13 +57,13 @@ var (
ErrNotSupported
=
ProtocolError
{
"not supported"
}
)
//
WebSocket
Addr is an implementation of net.Addr for WebSocket.
type
WebSocket
Addr
struct
{
// Addr is an implementation of net.Addr for WebSocket.
type
Addr
struct
{
*
url
.
URL
}
// Network returns the network type for a WebSocket, "websocket".
func
(
addr
WebSocket
Addr
)
Network
()
string
{
return
"websocket"
}
func
(
addr
*
Addr
)
Network
()
string
{
return
"websocket"
}
// Config is a WebSocket configuration
type
Config
struct
{
...
...
@@ -219,18 +219,18 @@ func (ws *Conn) IsServerConn() bool { return ws.request != nil }
// the WebSocket location for server.
func
(
ws
*
Conn
)
LocalAddr
()
net
.
Addr
{
if
ws
.
IsClientConn
()
{
return
WebSocket
Addr
{
ws
.
config
.
Origin
}
return
&
Addr
{
ws
.
config
.
Origin
}
}
return
WebSocket
Addr
{
ws
.
config
.
Location
}
return
&
Addr
{
ws
.
config
.
Location
}
}
// RemoteAddr returns the WebSocket location for the connection for client, or
// the Websocket Origin for server.
func
(
ws
*
Conn
)
RemoteAddr
()
net
.
Addr
{
if
ws
.
IsClientConn
()
{
return
WebSocket
Addr
{
ws
.
config
.
Location
}
return
&
Addr
{
ws
.
config
.
Location
}
}
return
WebSocket
Addr
{
ws
.
config
.
Origin
}
return
&
Addr
{
ws
.
config
.
Origin
}
}
// SetTimeout sets the connection's network timeout in nanoseconds.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment