internet_address local_addr = internet_address
(internet_address::localhost(), client->stack().hostname(), 0);
open_common(local_addr); // open the common support for biz.
internet_address local_addr = internet_address
(internet_address::localhost(), client->stack().hostname(), 0);
open_common(local_addr); // open the common support for biz.
bool saw_something = false; // true if we got a packet.
while (actions++ < MAXIMUM_ACTIONS_PER_CLIENT) {
// pull in anything waiting.
bool saw_something = false; // true if we got a packet.
while (actions++ < MAXIMUM_ACTIONS_PER_CLIENT) {
// pull in anything waiting.
octopus_request_id req_id;
outcome ret = retrieve_and_restore_any(item, req_id,
first_one? DATA_AWAIT_TIMEOUT : 0);
octopus_request_id req_id;
outcome ret = retrieve_and_restore_any(item, req_id,
first_one? DATA_AWAIT_TIMEOUT : 0);
_accepting_threads(accepting_threads),
_dropper(new client_dropping_thread(*this)),
_enabled(false),
_accepting_threads(accepting_threads),
_dropper(new client_dropping_thread(*this)),
_enabled(false),
// identity is not wrapped with encryption; we need to establish and identity
// to talk on a distinct channel with the server. even if that identity were
// compromised, the interloper should still not be able to listen in on the
// identity is not wrapped with encryption; we need to establish and identity
// to talk on a distinct channel with the server. even if that identity were
// compromised, the interloper should still not be able to listen in on the
// itself is not encrypted and we don't want to re-encrypt the wrapper.
if (dynamic_cast<identity_infoton *>(request)
|| dynamic_cast<encryption_infoton *>(request)
// itself is not encrypted and we don't want to re-encrypt the wrapper.
if (dynamic_cast<identity_infoton *>(request)
|| dynamic_cast<encryption_infoton *>(request)
// lock here is released a bit down below.
if (!key) {
LOG(astring("failed to locate key for entity ") + ent.text_form());
// lock here is released a bit down below.
if (!key) {
LOG(astring("failed to locate key for entity ") + ent.text_form());
}
byte_array packed_request;
infoton::fast_pack(packed_request, *request);
}
byte_array packed_request;
infoton::fast_pack(packed_request, *request);
#endif
for (int i = 0; i < _accepting_threads; i++) {
// crank in a new thread and tell it yes on starting it.
#endif
for (int i = 0; i < _accepting_threads; i++) {
// crank in a new thread and tell it yes on starting it.
if (!_enabled) return;
_dropper->stop(); // signal the thread to leave when it can.
_accepters->stop_all(); // signal the accepting threads to exit.
if (!_enabled) return;
_dropper->stop(); // signal the thread to leave when it can.
_accepters->stop_all(); // signal the accepting threads to exit.
//printf((timestamp(true, true) + "into accept\n").s());
outcome ret = spock()->accept(accepted, wait);
//printf((timestamp(true, true) + "out of accept\n").s());
//printf((timestamp(true, true) + "into accept\n").s());
outcome ret = spock()->accept(accepted, wait);
//printf((timestamp(true, true) + "out of accept\n").s());
outcome cromp_server::get_from_client(const octopus_request_id &id,
infoton * &data, int timeout)
{
outcome cromp_server::get_from_client(const octopus_request_id &id,
infoton * &data, int timeout)
{
if (!_enabled) return common::INCOMPLETE;
//hmmm: this implementation locks the lists; can't we get the client to do
// most of the work for this?
if (!_enabled) return common::INCOMPLETE;
//hmmm: this implementation locks the lists; can't we get the client to do
// most of the work for this?