Comments (2)
If connect to 2 servers, looks the first connection is closed? Does this mean wangle could NOT share IOThreadPool among connections?
diff --git a/wangle/example/echo/EchoClient.cpp b/wangle/example/echo/EchoClient.cpp
index 5ee0cad..5f101ee 100644
--- a/wangle/example/echo/EchoClient.cpp
+++ b/wangle/example/echo/EchoClient.cpp
@@ -63,23 +63,46 @@ int main(int argc, char** argv) {
client.group(std::make_sharedwangle::IOThreadPoolExecutor(1));
client.pipelineFactory(std::make_shared());
auto pipeline = client.connect(SocketAddress(FLAGS_host, FLAGS_port)).get();
++ auto pipeline1 = client.connect(SocketAddress(FLAGS_host, 8070)).get();
./bin/EchoClient -v=5
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0414 03:18:42.539069 13215 EventBase.cpp:164] EventBase(): Created.
I0414 03:18:42.540269 13215 EventBase.cpp:295] EventBase(): Starting loop.
I0414 03:18:42.540786 13214 EventBase.cpp:164] EventBase(): Created.
I0414 03:18:42.541205 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 0
I0414 03:18:42.541543 13215 AsyncSocket.cpp:192] new AsyncSocket(0x7f6910001950, evb=0x7f6910000af0)
I0414 03:18:42.541913 13215 AsyncSocket.cpp:383] AsyncSocket::connect(this=0x7f6910001950, evb=0x7f6910000af0, fd=11, host=[::1]:8080
I0414 03:18:42.575080 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 33
I0414 03:18:42.575783 13215 AsyncSocket.cpp:1401] AsyncSocket::handleWrite() this=0x7f6910001950, fd=11, state=1
I0414 03:18:42.576248 13215 AsyncSocket.cpp:1573] AsyncSocket::handleConnect() this=0x7f6910001950, fd=11, state=1
I0414 03:18:42.576648 13215 AsyncSocket.cpp:1750] AsyncSocket::updateEventRegistration(this=0x7f6910001950, fd=11, evb=0x7f6910000af0, state=2, events=2
I0414 03:18:42.576925 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 1
I0414 03:18:42.576954 13215 AsyncSocket.cpp:192] new AsyncSocket(0x7f69100022f0, evb=0x7f6910000af0)
I0414 03:18:42.577000 13215 AsyncSocket.cpp:383] AsyncSocket::connect(this=0x7f69100022f0, evb=0x7f6910000af0, fd=12, host=[::1]:8070
I0414 03:18:42.577679 13215 AsyncSocket.cpp:1750] AsyncSocket::updateEventRegistration(this=0x7f6910001950, fd=11, evb=0x7f6910000af0, state=2, events=0
I0414 03:18:42.577715 13215 AsyncSocket.cpp:250] AsyncSocket::destroy(this=0x7f6910001950, evb=0x7f6910000af0, fd=11, state=2
I0414 03:18:42.577729 13215 AsyncSocket.cpp:812] AsyncSocket::closeNow(): this=0x7f6910001950, fd_=11, state=2, shutdownFlags=0
I0414 03:18:42.577813 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 0
I0414 03:18:42.578115 13215 AsyncSocket.cpp:1401] AsyncSocket::handleWrite() this=0x7f69100022f0, fd=12, state=1
I0414 03:18:42.578132 13215 AsyncSocket.cpp:1573] AsyncSocket::handleConnect() this=0x7f69100022f0, fd=12, state=1
I0414 03:18:42.578147 13215 AsyncSocket.cpp:1750] AsyncSocket::updateEventRegistration(this=0x7f69100022f0, fd=12, evb=0x7f6910000af0, state=2, events=2
I0414 03:18:42.578207 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 0
I0414 03:18:48.651737 13215 EventBase.cpp:401] EventBase 0x7f6910000af0 loop time: 6073
1
Segmentation fault
from wangle.
It turned out to be a misuse. When ClientBootstrap sets up the second connection, the original pipeline will be automatically destroyed, as ClientBootstrap.connect returns future(Pipeline*), not share_ptr.
Has to create two ClientBootstrap instances.
from wangle.
Related Issues (20)
- Failed to run example echo examples HOT 3
- ByteToMessageDecoder decode
- Too many dangling CLOSE_WAIT connections HOT 5
- error: no member named 'tcpi_retransmits' in 'tcp_info'; did you mean '__tcpi_retransmits'? HOT 3
- Installs empty directories
- if iouring will be supported soon?
- Build fails on Debian Buster: Acceptor.cpp.o SocketPeeker.h:25:67: error: expected class-name before ‘,’ token
- failed to install wangle on windows with vcpkg install wangle command HOT 1
- very poor performance with echo example HOT 1
- Function with noexcept specifier throws exception causes program terminated HOT 3
- enable tcp and udp in single ServerBootstrap HOT 1
- run client on browser
- Wangle - Vcpkg - Windows (wvw)
- Problem linking libsodium HOT 3
- Incompatibility with openssl3 HOT 5
- test failure HOT 1
- Access Pipelines from Server
- MacOS encounter this issue. plz help me with this.
- Q: Does wangle support websockets?
- Acceptor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wangle.