Search found 40 matches

Go to advanced search

by codecandy2k
21 Mar 2012, 18:15
Forum: Support
Topic: SocketAcceptor<CMyServiceHandler> acceptor(svs, reactor)
Replies: 5
Views: 1319

Re: SocketAcceptor<CMyServiceHandler> acceptor(svs, reactor)

Reactor uses a single-threaded model. A thread-per-connection model does not scale well. What I would suggest in your situation is to create a thread-pool for request processing, and just use your onReadable to read the data from the socket and handle any deframing, then post the requests to a worke...
by codecandy2k
19 Mar 2012, 21:13
Forum: Support
Topic: Poco::SharedPtr is thread safe?
Replies: 4
Views: 1285

Re: Poco::SharedPtr is thread safe?

The reference counting is thread-safe, so using different SharedPtr objects that share the same counter in different threads should be safe, but I don't think it's safe to access the same SharedPtr from different threads. assign is not an atomic operation, for instance. It's probably safe for read-o...
by codecandy2k
19 Mar 2012, 17:31
Forum: Support
Topic: Poco::SharedPtr is thread safe?
Replies: 4
Views: 1285

Re: Poco::SharedPtr is thread safe?

SharedPtr is not thread-safe.
by codecandy2k
19 Mar 2012, 16:49
Forum: Support
Topic: realize telnet login
Replies: 3
Views: 943

Re: realize telnet login

Not sure if it's your problem, but at a quick glance you're probably sending too much data. ret = mDialogSocket->sendBytes(buffer,DEFAULT_BUFLEN); should be ret = mDialogSocket->sendBytes(buffer,std::strlen(buffer)); If that doesn't help I'll take a look at it when I get a chance. In the meantime I'...
by codecandy2k
16 Mar 2012, 06:26
Forum: Support
Topic: Reactor framework use for client TCP socket
Replies: 1
Views: 848

Re: Reactor framework use for client TCP socket

It should be. I have never specifically done it but I believe you should be able to just launch a SocketReactor in a thread (it is a Runnable) and call it's addEventHandler method to register your socket. As far as I know it doesn't really care if it's a server or client socket.
by codecandy2k
12 Mar 2012, 18:16
Forum: Support
Topic: Poco::Timestamp void update(); is threadsafe?
Replies: 1
Views: 693

Re: Poco::Timestamp void update(); is threadsafe?

No, Timestamp is not thread-safe. If you need to share a Timestamp object between multiple threads you should wrap access with a mutex lock.
by codecandy2k
12 Mar 2012, 18:03
Forum: Support
Topic: ping needs root acces
Replies: 1
Views: 687

Re: ping needs root acces

And is there a way to get it working without having root access ? Nope. Why ? ICMP uses raw sockets, which require root privileges on Linux. The 'ping' command on Linux is typically owned by root and has the SUID bit set, so it always runs as root. You can do the same with your application with the...
by codecandy2k
09 Mar 2012, 02:03
Forum: Support
Topic: HTTPSession timeouts
Replies: 2
Views: 880

Re: HTTPSession timeouts

Socket::setReceiveTimeout is not a timeout for all data to be downloaded, it is a timeout for 'recv' calls on the native socket, and only matters if no data at all is received before the timeout expires. There may be more than one recv call per HTTP request, so if there is a long pause with no data ...
by codecandy2k
07 Mar 2012, 19:13
Forum: Support
Topic: Broken reference counting using TaskManager
Replies: 3
Views: 867

Re: Broken reference counting using TaskManager

TaskManager::postNotification is a protected method used internally for passing progress notifications, for which there is no good reason to keep a reference after posting. It might be a good idea to have it take an AutoPtr to avoid misuse in derived classes, but I think it's really just meant to ta...
by codecandy2k
01 Mar 2012, 06:16
Forum: Support
Topic: Compile POCO using MinGW-64
Replies: 1
Views: 661

Re: Compile POCO using MinGW-64

There doesn't appear to be a 64-bit build configuration for MinGW. You'll either need to create a new build configuration or modify the existing MinGW build configuration in /build/config. Off the top you'll need to change POCO_TARGET_OSARCH to x64 and replace _WIN32 with _WIN64 in SYSFLAGS. There m...

Go to advanced search

cron