Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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
00058
00059 virtual void upgradeEtype(EventType & ) { };
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
00070 off_t netHandler_offset;
00071 off_t pollCont_offset;
00072
00073
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
00092
00093
00094
00095 extern void initialize_thread_for_net(EThread * thread);
00096
00097
00098 #endif