亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? connection_handler.cpp

?? 一個(gè)開源的網(wǎng)絡(luò)開發(fā)庫ACE
?? CPP
字號:
// Connection_Handler.cpp,v 4.5 1998/07/31 23:36:42 gonzo Exp

#define ACE_BUILD_SVC_DLL

#include "Event_Channel.h"
#include "Concrete_Connection_Handlers.h"

ACE_RCSID(Gateway, Connection_Handler, "Connection_Handler.cpp,v 4.5 1998/07/31 23:36:42 gonzo Exp")

Event_Channel *
Connection_Handler::event_channel (void) const
{
  return this->event_channel_;
}

void
Connection_Handler::event_channel (Event_Channel *ec)
{
  this->event_channel_ = ec;
}

void
Connection_Handler::connection_id (CONNECTION_ID id)
{
  this->connection_id_ = id;
}

CONNECTION_ID
Connection_Handler::connection_id (void) const
{
  return this->connection_id_;
}

// The total number of bytes sent/received on this Proxy.

size_t
Connection_Handler::total_bytes (void) const
{
  return this->total_bytes_;
}

void
Connection_Handler::total_bytes (size_t bytes)
{
  this->total_bytes_ += bytes;
}

Connection_Handler::Connection_Handler (void)
{
}

Connection_Handler::Connection_Handler (const Connection_Config_Info &pci)
  : remote_addr_ (pci.remote_port_, pci.host_[0] == '\0' ? ACE_DEFAULT_SERVER_HOST : pci.host_),
    local_addr_ (pci.local_port_),
    connection_id_ (pci.connection_id_),
    total_bytes_ (0),
    state_ (Connection_Handler::IDLE),
    timeout_ (1),
    max_timeout_ (pci.max_retry_timeout_),
    event_channel_ (pci.event_channel_)
{
  // Set the priority of the Proxy.
  this->priority (int (pci.priority_));
}

// Set the connection_role.

void
Connection_Handler::connection_role (char d)
{
  this->connection_role_ = d;
}

// Get the connection_role.

char
Connection_Handler::connection_role (void) const
{
  return this->connection_role_;
}

// Sets the timeout delay.

void
Connection_Handler::timeout (int to)
{
  if (to > this->max_timeout_)
    to = this->max_timeout_;

  this->timeout_ = to;
}

// Re-calculate the current retry timeout delay using exponential
// backoff.  Returns the original timeout (i.e., before the
// re-calculation).

int
Connection_Handler::timeout (void)
{
  int old_timeout = this->timeout_;
  this->timeout_ *= 2;

  if (this->timeout_ > this->max_timeout_)
    this->timeout_ = this->max_timeout_;

  return old_timeout;
}

// Sets the max timeout delay.

void
Connection_Handler::max_timeout (int mto)
{
  this->max_timeout_ = mto;
}

// Gets the max timeout delay.

int
Connection_Handler::max_timeout (void) const
{
  return this->max_timeout_;
}

// Restart connection asynchronously when timeout occurs.

int
Connection_Handler::handle_timeout (const ACE_Time_Value &,
                                    const void *)
{
  ACE_DEBUG ((LM_DEBUG,
	     "(%t) attempting to reconnect Connection_Handler %d with timeout = %d\n",
              this->connection_id (),
              this->timeout_));

  // Delegate the re-connection attempt to the Event Channel.
  this->event_channel_->initiate_connection_connection (this);

  return 0;
}

// Handle shutdown of the Connection_Handler object.

int
Connection_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
{
  ACE_DEBUG ((LM_DEBUG,
	      "(%t) shutting down %s Connection_Handler %d on handle %d\n",
	      this->connection_role () == 'C' ? "Consumer" : "Supplier",
	      this->connection_id (), 
              this->get_handle ()));

  // Restart the connection, if possible.
  return this->event_channel_->reinitiate_connection_connection (this);
}

// Set the state of the Proxy.

void
Connection_Handler::state (Connection_Handler::State s)
{
  this->state_ = s;
}

// Return the current state of the Proxy.

Connection_Handler::State
Connection_Handler::state (void) const
{
  return this->state_;
}

// Upcall from the <ACE_Acceptor> or <ACE_Connector> that delegates
// control to our Connection_Handler.

int
Connection_Handler::open (void *)
{
  ACE_DEBUG ((LM_DEBUG, "(%t) %s Connection_Handler's handle = %d\n",
	      this->connection_role () == 'C' ? "Consumer" : "Supplier",
	      this->peer ().get_handle ()));

  // Call back to the <Event_Channel> to complete our initialization.
  if (this->event_channel_->complete_connection_connection (this) == -1)
    ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "complete_connection_connection"), -1);

  // Turn on non-blocking I/O.
  else if (this->peer ().enable (ACE_NONBLOCK) == -1)
    ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "enable"), -1);

  // Register ourselves to receive input events.
  else if (ACE_Reactor::instance ()->register_handler
      (this, ACE_Event_Handler::READ_MASK) == -1)
    ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "register_handler"), -1);
  else
    return 0;
}

const ACE_INET_Addr &
Connection_Handler::remote_addr (void) const
{
  return this->remote_addr_;
}

void
Connection_Handler::remote_addr (ACE_INET_Addr &ra)
{
  this->remote_addr_ = ra;
}

const ACE_INET_Addr &
Connection_Handler::local_addr (void) const
{
  return this->local_addr_;
}

void
Connection_Handler::local_addr (ACE_INET_Addr &la)
{
  this->local_addr_ = la;
}

// Make the appropriate type of <Connection_Handler> (i.e.,
// <Consumer_Handler>, <Supplier_Handler>, <Thr_Consumer_Handler>, or
// <Thr_Supplier_Handler>).

Connection_Handler *
Connection_Handler_Factory::make_connection_handler (const Connection_Config_Info &pci)
{
  Connection_Handler *connection_handler = 0;

  // The next few lines of code are dependent on whether we are making
  // a threaded/reactive Supplier_Handler/Consumer_Handler.

  if (pci.connection_role_ == 'C') // Configure a Consumer_Handler.
    {
      // Create a threaded Consumer_Handler.
      if (ACE_BIT_ENABLED (Options::instance ()->threading_strategy (),
			   Options::OUTPUT_MT))
	ACE_NEW_RETURN (connection_handler,
			Thr_Consumer_Handler (pci),
			0);

      // Create a reactive Consumer_Handler.
      else
	ACE_NEW_RETURN (connection_handler,
			Consumer_Handler (pci),
			0);
    }
  else // connection_role == 'S', so configure a Supplier_Handler.
    {
      // Create a threaded Supplier_Handler.
      if (ACE_BIT_ENABLED (Options::instance ()->threading_strategy (),
			   Options::INPUT_MT))
	ACE_NEW_RETURN (connection_handler,
			Thr_Supplier_Handler (pci),
			0);

      // Create a reactive Supplier_Handler.
      else
	ACE_NEW_RETURN (connection_handler,
			Supplier_Handler (pci),
			0);
    }

  return connection_handler;
}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Map_Entry<Event_Key, Consumer_Dispatch_Set *>;
template class ACE_Map_Iterator_Base<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>;
template class ACE_Map_Iterator<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>;
template class ACE_Map_Reverse_Iterator<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>;
template class ACE_Map_Manager<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>;
template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
#if defined (ACE_HAS_THREADS)
template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH>;
#endif /* ACE_HAS_THREADS */
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Map_Entry<Event_Key, Consumer_Dispatch_Set *>
#pragma instantiate ACE_Map_Iterator<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>
#pragma instantiate ACE_Map_Reverse_Iterator<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>
#pragma instantiate ACE_Map_Iterator_Base<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>
#pragma instantiate ACE_Map_Manager<Event_Key, Consumer_Dispatch_Set *, MAP_MUTEX>
#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
#if defined (ACE_HAS_THREADS)
#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH>
#endif /* ACE_HAS_THREADS */
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费在线视频| 久久综合久久鬼色中文字| 一区二区三区在线视频免费观看 | 欧美日韩国产美女| 国产剧情一区二区| 亚洲狠狠爱一区二区三区| 久久久久久99久久久精品网站| 欧美专区亚洲专区| 不卡视频在线看| 国产一区欧美一区| 日本美女一区二区三区| 亚洲高清在线精品| 久久精子c满五个校花| 欧美日韩一区二区欧美激情| 成人h动漫精品一区二区| www欧美成人18+| 欧美一区二区三区人| 成人av网站在线观看免费| 久久精品99国产精品日本| 五月天激情小说综合| 国产精品电影一区二区| 日本一区二区免费在线观看视频 | 爽好久久久欧美精品| 一区二区久久久久久| 一区二区三区成人在线视频| 国产精品对白交换视频| 综合激情网...| 国产一区二区调教| 久久91精品国产91久久小草| 麻豆91在线看| 国产一区二区三区在线观看精品 | 九色综合狠狠综合久久| 日韩高清在线电影| 国产麻豆9l精品三级站| 成人午夜视频免费看| 色天天综合色天天久久| 欧美日韩精品一区二区天天拍小说| 6080午夜不卡| 欧美tickling挠脚心丨vk| 欧美激情综合在线| 性久久久久久久| 欧美中文字幕不卡| 久久电影网电视剧免费观看| 亚洲国产日韩精品| 激情五月婷婷综合| 欧美亚洲综合在线| 久久蜜桃av一区二区天堂| 亚洲视频网在线直播| 蜜臀久久99精品久久久久久9| 国产福利一区二区三区在线视频| 成人动漫一区二区三区| 日韩无一区二区| 亚洲一区免费观看| 从欧美一区二区三区| 日韩精品一区二区三区老鸭窝| 中文字幕日韩欧美一区二区三区| 亚洲综合一二三区| 99re热这里只有精品视频| 久久久亚洲国产美女国产盗摄| 亚洲自拍偷拍av| 色婷婷久久一区二区三区麻豆| 久久嫩草精品久久久精品一| 日韩国产欧美在线观看| 色综合av在线| 亚洲欧美激情小说另类| 北条麻妃国产九九精品视频| 欧美tickling挠脚心丨vk| 日本三级韩国三级欧美三级| 97久久超碰精品国产| 中文字幕亚洲电影| 成人黄色电影在线 | 日本欧美一区二区| 欧美日韩中文字幕一区| 亚洲免费av高清| 成人深夜在线观看| 久久久亚洲精品一区二区三区| 美日韩一级片在线观看| 日韩一区二区视频| 国产原创一区二区三区| 久久一夜天堂av一区二区三区| 久久国产成人午夜av影院| 26uuu色噜噜精品一区| 国产乱码精品一区二区三区五月婷| 久久综合色婷婷| 国产91丝袜在线播放| 亚洲免费资源在线播放| 欧美主播一区二区三区| 日韩精品久久久久久| 久久久99精品免费观看不卡| 99久久免费视频.com| 亚洲图片欧美视频| 久久青草欧美一区二区三区| 成人丝袜高跟foot| 香蕉成人伊视频在线观看| 日韩午夜在线观看视频| 国产高清无密码一区二区三区| 亚洲精品欧美二区三区中文字幕| 欧美麻豆精品久久久久久| 国模套图日韩精品一区二区 | 亚洲成人综合在线| 国产亚洲人成网站| 91麻豆精品久久久久蜜臀| 盗摄精品av一区二区三区| 亚洲h精品动漫在线观看| 国产亚洲欧美激情| 在线观看免费成人| 夜色激情一区二区| 日韩精品影音先锋| 91色porny| 风间由美一区二区av101 | 日韩精品电影在线| 亚洲男人的天堂av| 国产精品久久久久aaaa樱花| 2023国产精品自拍| 日韩欧美综合在线| 欧美在线免费观看亚洲| 不卡的看片网站| 国产凹凸在线观看一区二区| 麻豆精品久久精品色综合| 日韩成人一级片| 欧美日韩免费观看一区三区| 午夜精品一区二区三区三上悠亚| 亚洲天天做日日做天天谢日日欢| 国产精品亲子伦对白| 欧美激情一区三区| 中文字幕一区二区三区视频| 精品国产乱码久久久久久闺蜜 | 亚洲精选一二三| 亚洲人吸女人奶水| 亚洲第一福利一区| 三级不卡在线观看| 极品美女销魂一区二区三区免费| 免费av成人在线| 国产精品一二三区| 成人免费看的视频| 91亚洲资源网| 欧美亚男人的天堂| 欧美成人性战久久| 国产精品美女一区二区三区| 一区二区三区在线高清| 视频一区二区三区入口| 国产在线麻豆精品观看| 99视频在线观看一区三区| 99久久er热在这里只有精品15| 欧洲人成人精品| 久久亚洲一区二区三区四区| 18涩涩午夜精品.www| 美女精品自拍一二三四| 粗大黑人巨茎大战欧美成人| 欧美美女一区二区| 国产精品美日韩| 美女爽到高潮91| 在线免费亚洲电影| 日本一区二区三区电影| 日韩在线一区二区三区| 99久久精品情趣| 久久伊99综合婷婷久久伊| 夜夜精品视频一区二区 | 国产精品天天摸av网| 午夜欧美2019年伦理| 99re在线视频这里只有精品| 日韩欧美国产一区在线观看| 一区二区三区国产豹纹内裤在线| 国产一区二区三区免费在线观看| 欧美日韩亚洲综合在线| 国产精品久久99| 成人蜜臀av电影| 国产精品卡一卡二| 国产成人av福利| 久久先锋影音av鲁色资源 | 日本欧美久久久久免费播放网| 99精品国产视频| 亚洲女与黑人做爰| 色哟哟一区二区在线观看 | 亚洲伦理在线精品| 一本大道久久a久久综合| 日韩三级在线免费观看| 中文字幕一区二区三区在线不卡| 奇米精品一区二区三区在线观看| 欧美日韩在线精品一区二区三区激情| 亚洲精品va在线观看| 91精彩视频在线| 日韩中文字幕区一区有砖一区 | 亚洲人成亚洲人成在线观看图片 | 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 日韩成人午夜精品| 欧美一区午夜视频在线观看| 男人的天堂久久精品| 精品国产三级a在线观看| 国产在线精品一区二区三区不卡| 欧美精品一区二区久久久| 国产精品一区二区三区乱码| 亚洲美女视频在线观看| 欧美日韩国产片| 成人午夜碰碰视频| 亚洲成人精品在线观看| 国产三级欧美三级日产三级99| 91丨九色porny丨蝌蚪| 青青草国产精品亚洲专区无| 中文在线免费一区三区高中清不卡|