Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
b5001ff8
Commit
b5001ff8
authored
13 years ago
by
Oz Linden
Browse files
Options
Downloads
Plain Diff
merge changes for storm-1368
parents
cc73cf15
c91d6962
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
autobuild.xml
+3
-12
3 additions, 12 deletions
autobuild.xml
indra/llmessage/lliosocket.cpp
+21
-5
21 additions, 5 deletions
indra/llmessage/lliosocket.cpp
indra/llmessage/lliosocket.h
+9
-2
9 additions, 2 deletions
indra/llmessage/lliosocket.h
with
33 additions
and
19 deletions
autobuild.xml
+
3
−
12
View file @
b5001ff8
...
...
@@ -1907,11 +1907,8 @@
<map>
<key>
build
</key>
<map>
<key>
argument
s
</key>
<key>
filter
s
</key>
<array>
<string>
|
</string>
<string>
grep
</string>
<string>
-v
</string>
<string>
setenv
</string>
</array>
<key>
command
</key>
...
...
@@ -1964,11 +1961,8 @@
<map>
<key>
build
</key>
<map>
<key>
argument
s
</key>
<key>
filter
s
</key>
<array>
<string>
|
</string>
<string>
grep
</string>
<string>
-v
</string>
<string>
setenv
</string>
</array>
<key>
command
</key>
...
...
@@ -2023,11 +2017,8 @@
<map>
<key>
build
</key>
<map>
<key>
argument
s
</key>
<key>
filter
s
</key>
<array>
<string>
|
</string>
<string>
grep
</string>
<string>
-v
</string>
<string>
setenv
</string>
</array>
<key>
command
</key>
...
...
This diff is collapsed.
Click to expand it.
indra/llmessage/lliosocket.cpp
+
21
−
5
View file @
b5001ff8
...
...
@@ -191,7 +191,7 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port)
port
=
PORT_EPHEMERAL
;
}
rv
->
mPort
=
port
;
rv
->
set
Options
();
rv
->
set
NonBlocking
();
return
rv
;
}
...
...
@@ -206,7 +206,7 @@ LLSocket::ptr_t LLSocket::create(apr_socket_t* socket, apr_pool_t* pool)
}
rv
=
ptr_t
(
new
LLSocket
(
socket
,
pool
));
rv
->
mPort
=
PORT_EPHEMERAL
;
rv
->
set
Options
();
rv
->
set
NonBlocking
();
return
rv
;
}
...
...
@@ -227,10 +227,10 @@ bool LLSocket::blockingConnect(const LLHost& host)
{
return
false
;
}
apr_socket_timeout_set
(
mSocket
,
1000
);
setBlocking
(
1000
);
ll_debug_socket
(
"Blocking connect"
,
mSocket
);
if
(
ll_apr_warn_status
(
apr_socket_connect
(
mSocket
,
sa
)))
return
false
;
set
Options
();
set
NonBlocking
();
return
true
;
}
...
...
@@ -258,11 +258,27 @@ LLSocket::~LLSocket()
}
}
void
LLSocket
::
setOptions
()
// See http://dev.ariel-networks.com/apr/apr-tutorial/html/apr-tutorial-13.html#ss13.4
// for an explanation of how to get non-blocking sockets and timeouts with
// consistent behavior across platforms.
void
LLSocket
::
setBlocking
(
S32
timeout
)
{
LLMemType
m1
(
LLMemType
::
MTYPE_IO_TCP
);
// set up the socket options
ll_apr_warn_status
(
apr_socket_timeout_set
(
mSocket
,
timeout
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_NONBLOCK
,
0
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_SNDBUF
,
LL_SEND_BUFFER_SIZE
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_RCVBUF
,
LL_RECV_BUFFER_SIZE
));
}
void
LLSocket
::
setNonBlocking
()
{
LLMemType
m1
(
LLMemType
::
MTYPE_IO_TCP
);
// set up the socket options
ll_apr_warn_status
(
apr_socket_timeout_set
(
mSocket
,
0
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_NONBLOCK
,
1
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_SNDBUF
,
LL_SEND_BUFFER_SIZE
));
ll_apr_warn_status
(
apr_socket_opt_set
(
mSocket
,
APR_SO_RCVBUF
,
LL_RECV_BUFFER_SIZE
));
...
...
This diff is collapsed.
Click to expand it.
indra/llmessage/lliosocket.h
+
9
−
2
View file @
b5001ff8
...
...
@@ -153,9 +153,16 @@ class LLSocket
LLSocket
(
apr_socket_t
*
socket
,
apr_pool_t
*
pool
);
/**
* @brief Set default socket options.
* @brief Set default socket options, with SO_NONBLOCK = 0 and a timeout in us.
* @param timeout Number of microseconds to wait on this socket. Any
* negative number means block-forever. TIMEOUT OF 0 IS NON-PORTABLE.
*/
void
setOptions
();
void
setBlocking
(
S32
timeout
);
/**
* @brief Set default socket options, with SO_NONBLOCK = 1 and timeout = 0.
*/
void
setNonBlocking
();
public
:
/**
...
...
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