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
cc9a94d5
Commit
cc9a94d5
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
up
parent
b36f7eda
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
utils/solvers/c++/GmshSocket.h
+5
-4
5 additions, 4 deletions
utils/solvers/c++/GmshSocket.h
with
5 additions
and
4 deletions
utils/solvers/c++/GmshSocket.h
+
5
−
4
View file @
cc9a94d5
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
// OF THIS SOFTWARE.
// OF THIS SOFTWARE.
//
//
// Please report all bugs and problems to the public mailing list <gmsh@geuz.org>.
// Please report all bugs and problems to the public mailing list
// <gmsh@geuz.org>.
#ifndef _GMSH_SOCKET_H_
#ifndef _GMSH_SOCKET_H_
#define _GMSH_SOCKET_H_
#define _GMSH_SOCKET_H_
...
@@ -80,6 +81,7 @@ class GmshSocket{
...
@@ -80,6 +81,7 @@ class GmshSocket{
GMSH_SPEED_TEST
=
30
,
GMSH_SPEED_TEST
=
30
,
GMSH_PARAMETER_CLEAR
=
31
,
GMSH_PARAMETER_CLEAR
=
31
,
GMSH_PARAMETER_UPDATE
=
32
,
GMSH_PARAMETER_UPDATE
=
32
,
GMSH_OPEN_PROJECT
=
33
,
GMSH_OPTION_1
=
100
,
GMSH_OPTION_1
=
100
,
GMSH_OPTION_2
=
101
,
GMSH_OPTION_2
=
101
,
GMSH_OPTION_3
=
102
,
GMSH_OPTION_3
=
102
,
...
@@ -188,6 +190,7 @@ class GmshSocket{
...
@@ -188,6 +190,7 @@ class GmshSocket{
void
Error
(
const
char
*
str
){
SendString
(
GMSH_ERROR
,
str
);
}
void
Error
(
const
char
*
str
){
SendString
(
GMSH_ERROR
,
str
);
}
void
Progress
(
const
char
*
str
){
SendString
(
GMSH_PROGRESS
,
str
);
}
void
Progress
(
const
char
*
str
){
SendString
(
GMSH_PROGRESS
,
str
);
}
void
MergeFile
(
const
char
*
str
){
SendString
(
GMSH_MERGE_FILE
,
str
);
}
void
MergeFile
(
const
char
*
str
){
SendString
(
GMSH_MERGE_FILE
,
str
);
}
void
OpenProject
(
const
char
*
str
){
SendString
(
GMSH_OPEN_PROJECT
,
str
);
}
void
ParseString
(
const
char
*
str
){
SendString
(
GMSH_PARSE_STRING
,
str
);
}
void
ParseString
(
const
char
*
str
){
SendString
(
GMSH_PARSE_STRING
,
str
);
}
void
SpeedTest
(
const
char
*
str
){
SendString
(
GMSH_SPEED_TEST
,
str
);
}
void
SpeedTest
(
const
char
*
str
){
SendString
(
GMSH_SPEED_TEST
,
str
);
}
void
Option
(
int
num
,
const
char
*
str
)
void
Option
(
int
num
,
const
char
*
str
)
...
@@ -200,7 +203,6 @@ class GmshSocket{
...
@@ -200,7 +203,6 @@ class GmshSocket{
{
{
*
swap
=
0
;
*
swap
=
0
;
if
(
_ReceiveData
(
type
,
sizeof
(
int
))
>
0
){
if
(
_ReceiveData
(
type
,
sizeof
(
int
))
>
0
){
if
(
*
type
<
0
)
return
0
;
if
(
*
type
>
65535
){
if
(
*
type
>
65535
){
// the data comes from a machine with different endianness and
// the data comes from a machine with different endianness and
// we must swap the bytes
// we must swap the bytes
...
@@ -208,7 +210,6 @@ class GmshSocket{
...
@@ -208,7 +210,6 @@ class GmshSocket{
_SwapBytes
((
char
*
)
type
,
sizeof
(
int
),
1
);
_SwapBytes
((
char
*
)
type
,
sizeof
(
int
),
1
);
}
}
if
(
_ReceiveData
(
len
,
sizeof
(
int
))
>
0
){
if
(
_ReceiveData
(
len
,
sizeof
(
int
))
>
0
){
if
(
*
len
<
0
)
return
0
;
if
(
*
swap
)
_SwapBytes
((
char
*
)
len
,
sizeof
(
int
),
1
);
if
(
*
swap
)
_SwapBytes
((
char
*
)
len
,
sizeof
(
int
),
1
);
return
1
;
return
1
;
}
}
...
@@ -367,7 +368,7 @@ class GmshServer : public GmshSocket{
...
@@ -367,7 +368,7 @@ class GmshServer : public GmshSocket{
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(WIN32) || defined(__CYGWIN__)
if
(
tmpsock
<
0
)
if
(
tmpsock
<
0
)
#else
#else
if
(
tmpsock
==
(
int
)
INVALID_SOCKET
)
if
(
tmpsock
==
(
int
)
INVALID_SOCKET
)
#endif
#endif
throw
"Couldn't create socket"
;
throw
"Couldn't create socket"
;
// bind the socket to its name
// bind the socket to its name
...
...
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