Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
63d599ba
Commit
63d599ba
authored
Sep 02, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add (Client)SessionArray
parent
1ca66977
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
README.md
README.md
+4
-2
client.go
client.go
+15
-0
No files found.
README.md
View file @
63d599ba
...
@@ -13,9 +13,11 @@
...
@@ -13,9 +13,11 @@
-
2016/09/02
-
2016/09/02
> 1 add session.go:(gettyConn)close and session.go:(Session)dispose
> 1 add session.go:(gettyConn)close and session.go:(Session)dispose
>
>
> 2
add client.go:Client
> 2
modify return value of server.go:SessionCallback from void to err
>
>
> 3 version: 0.3.00
> 3 add client.go:Client
>
> 4 version: 0.3.00
-
2016/08/29
-
2016/08/29
> 1 rename reconnect to errFlag in function session.go:(Session)handlePackage
> 1 rename reconnect to errFlag in function session.go:(Session)handlePackage
...
...
client.go
View file @
63d599ba
...
@@ -94,6 +94,21 @@ func (this *Client) getSessionNum() int {
...
@@ -94,6 +94,21 @@ func (this *Client) getSessionNum() int {
return
num
return
num
}
}
func
(
this
*
Client
)
GetSessionArray
()
[]
*
Session
{
var
array
[]
*
Session
this
.
Lock
()
for
s
:=
range
this
.
sessionMap
{
if
s
.
IsClosed
()
{
delete
(
this
.
sessionMap
,
s
)
continue
}
array
=
append
(
array
,
s
)
}
this
.
Unlock
()
return
array
}
func
(
this
*
Client
)
connect
()
{
func
(
this
*
Client
)
connect
()
{
var
(
var
(
err
error
err
error
...
...
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