Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
01215dc2
Commit
01215dc2
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
keep track of recv/send bytes
parent
5466de7b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/GmshSocket.h
+7
-1
7 additions, 1 deletion
Common/GmshSocket.h
with
7 additions
and
1 deletion
Common/GmshSocket.h
+
7
−
1
View file @
01215dc2
...
...
@@ -98,6 +98,8 @@ class GmshSocket{
int
_sock
;
// the socket name
std
::
string
_sockname
;
// statistics
unsigned
long
int
_sent
,
_received
;
// send some data over the socket
int
_SendData
(
const
void
*
buffer
,
int
bytes
)
{
...
...
@@ -110,6 +112,7 @@ class GmshSocket{
sofar
+=
len
;
remaining
-=
len
;
}
while
(
remaining
>
0
);
_sent
+=
bytes
;
return
bytes
;
}
// receive some data over the socket
...
...
@@ -125,6 +128,7 @@ class GmshSocket{
sofar
+=
len
;
remaining
-=
len
;
}
while
(
remaining
>
0
);
_received
+=
bytes
;
return
bytes
;
}
// utility function to swap bytes in an array
...
...
@@ -149,7 +153,7 @@ class GmshSocket{
#endif
}
public
:
GmshSocket
()
:
_sock
(
0
)
GmshSocket
()
:
_sock
(
0
)
,
_sent
(
0
),
_received
(
0
)
{
#if defined(WIN32) && !defined(__CYGWIN__)
WSADATA
wsaData
;
...
...
@@ -250,6 +254,8 @@ class GmshSocket{
shutdown
(
s
,
SHUT_RDWR
);
#endif
}
unsigned
long
int
SentBytes
(){
return
_sent
;
}
unsigned
long
int
ReceivedBytes
(){
return
_received
;
}
};
class
GmshClient
:
public
GmshSocket
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment