• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

P_UnixNetProcessor.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 #ifndef __UNIXNETPROCESSOR_H__
00025 #define __UNIXNETPROCESSOR_H__
00026 #include "I_Net.h"
00027 #include "P_NetAccept.h"
00028 
00029 class UnixNetVConnection;
00030 
00031 //////////////////////////////////////////////////////////////////
00032 //
00033 //  class UnixNetProcessor
00034 //
00035 //////////////////////////////////////////////////////////////////
00036 struct UnixNetProcessor:public NetProcessor
00037 {
00038 public:
00039   virtual Action *accept_internal (
00040     Continuation * cont,
00041     int fd,
00042     AcceptOptions const &opt
00043   );
00044 
00045   Action *connect_re_internal(
00046     Continuation * cont,
00047     sockaddr const* target,
00048     NetVCOptions * options = NULL
00049   );
00050   Action *connect(
00051     Continuation * cont,
00052     UnixNetVConnection ** vc,
00053     sockaddr const* target,
00054     NetVCOptions * opt = NULL
00055   );
00056 
00057   // Virtual function allows etype to be upgraded to ET_SSL for SSLNetProcessor.  Does
00058   // nothing for NetProcessor
00059   virtual void upgradeEtype(EventType & /* etype ATS_UNUSED */) { };
00060 
00061   virtual NetAccept *createNetAccept();
00062   virtual NetVConnection * allocate_vc(EThread *t);
00063 
00064   virtual int start(int number_of_net_threads, size_t stacksize);
00065 
00066   char *throttle_error_message;
00067   Event *accept_thread_event;
00068 
00069   // offsets for per thread data structures
00070   off_t netHandler_offset;
00071   off_t pollCont_offset;
00072 
00073   // we probably wont need these members
00074   int n_netthreads;
00075   EThread **netthreads;
00076 };
00077 
00078 
00079 TS_INLINE Action *
00080 NetProcessor::connect_re(
00081   Continuation * cont,
00082   sockaddr const* addr,
00083   NetVCOptions * opts
00084 ) {
00085   return static_cast<UnixNetProcessor *>(this)->connect_re_internal(cont, addr, opts);
00086 }
00087 
00088 extern UnixNetProcessor unix_netProcessor;
00089 
00090 //
00091 // Set up a thread to receive events from the NetProcessor
00092 // This function should be called for all threads created to
00093 // accept such events by the EventProcesor.
00094 //
00095 extern void initialize_thread_for_net(EThread * thread);
00096 
00097 //#include "UnixNet.h"
00098 #endif

Generated by  doxygen 1.7.1