From 4d6d3859d208d5576e7149de9a0a5576b7cf5153 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Dec 2005 18:31:52 +0000 Subject: Added extra documentation for InspSocket (at last) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2356 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/socket_8cpp-source.html | 138 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 67 deletions(-) (limited to 'docs/module-doc/socket_8cpp-source.html') diff --git a/docs/module-doc/socket_8cpp-source.html b/docs/module-doc/socket_8cpp-source.html index 0a22a089d..d0acacdf1 100644 --- a/docs/module-doc/socket_8cpp-source.html +++ b/docs/module-doc/socket_8cpp-source.html @@ -203,9 +203,9 @@ 00194 return written; 00195 } 00196 -00197 bool InspSocket::Poll() +00197 bool InspSocket::Timeout(time_t current) 00198 { -00199 if ((time(NULL) > timeout_end) && (this->state == I_CONNECTING)) +00199 if ((this->state == I_CONNECTING) && (current > timeout_end)) 00200 { 00201 // for non-listening sockets, the timeout can occur 00202 // which causes termination of the connection after @@ -215,72 +215,76 @@ 00206 this->OnError(I_ERR_TIMEOUT); 00207 timeout = true; 00208 this->state = I_ERROR; -00209 return false; +00209 return true; 00210 } -00211 -00212 int incoming = -1; -00213 -00214 switch (this->state) -00215 { -00216 case I_CONNECTING: -00217 this->SetState(I_CONNECTED); -00218 /* Our socket was in write-state, so delete it and re-add it -00219 * in read-state. -00220 */ -00221 SE->DelFd(this->fd); -00222 SE->AddFd(this->fd,true,X_ESTAB_MODULE); -00223 return this->OnConnected(); -00224 break; -00225 case I_LISTENING: -00226 length = sizeof (client); -00227 incoming = accept (this->fd, (sockaddr*)&client,&length); -00228 this->OnIncomingConnection(incoming,inet_ntoa(client.sin_addr)); -00229 return true; -00230 break; -00231 case I_CONNECTED: -00232 return this->OnDataReady(); -00233 break; -00234 default: -00235 break; -00236 } -00237 -00238 return true; -00239 } -00240 -00241 void InspSocket::SetState(InspSocketState s) -00242 { -00243 log(DEBUG,"Socket state change"); -00244 this->state = s; -00245 } -00246 -00247 InspSocketState InspSocket::GetState() -00248 { -00249 return this->state; -00250 } -00251 -00252 int InspSocket::GetFd() -00253 { -00254 return this->fd; -00255 } -00256 -00257 bool InspSocket::OnConnected() { return true; } -00258 void InspSocket::OnError(InspSocketError e) { return; } -00259 int InspSocket::OnDisconnect() { return 0; } -00260 int InspSocket::OnIncomingConnection(int newfd, char* ip) { return 0; } -00261 bool InspSocket::OnDataReady() { return true; } -00262 void InspSocket::OnTimeout() { return; } -00263 void InspSocket::OnClose() { return; } -00264 -00265 InspSocket::~InspSocket() -00266 { -00267 this->Close(); -00268 } -00269 -00270 /* -00271 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr) -00272 int OpenTCPSocket (void) -00273 */ -
Generated on Mon Dec 12 13:31:08 2005 for InspIRCd by  +00211 return false; +00212 } +00213 +00214 bool InspSocket::Poll() +00215 { +00216 int incoming = -1; +00217 +00218 switch (this->state) +00219 { +00220 case I_CONNECTING: +00221 this->SetState(I_CONNECTED); +00222 /* Our socket was in write-state, so delete it and re-add it +00223 * in read-state. +00224 */ +00225 SE->DelFd(this->fd); +00226 SE->AddFd(this->fd,true,X_ESTAB_MODULE); +00227 return this->OnConnected(); +00228 break; +00229 case I_LISTENING: +00230 length = sizeof (client); +00231 incoming = accept (this->fd, (sockaddr*)&client,&length); +00232 this->OnIncomingConnection(incoming,inet_ntoa(client.sin_addr)); +00233 return true; +00234 break; +00235 case I_CONNECTED: +00236 return this->OnDataReady(); +00237 break; +00238 default: +00239 break; +00240 } +00241 +00242 return true; +00243 } +00244 +00245 void InspSocket::SetState(InspSocketState s) +00246 { +00247 log(DEBUG,"Socket state change"); +00248 this->state = s; +00249 } +00250 +00251 InspSocketState InspSocket::GetState() +00252 { +00253 return this->state; +00254 } +00255 +00256 int InspSocket::GetFd() +00257 { +00258 return this->fd; +00259 } +00260 +00261 bool InspSocket::OnConnected() { return true; } +00262 void InspSocket::OnError(InspSocketError e) { return; } +00263 int InspSocket::OnDisconnect() { return 0; } +00264 int InspSocket::OnIncomingConnection(int newfd, char* ip) { return 0; } +00265 bool InspSocket::OnDataReady() { return true; } +00266 void InspSocket::OnTimeout() { return; } +00267 void InspSocket::OnClose() { return; } +00268 +00269 InspSocket::~InspSocket() +00270 { +00271 this->Close(); +00272 } +00273 +00274 /* +00275 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr) +00276 int OpenTCPSocket (void) +00277 */ +
Generated on Mon Dec 12 18:30:58 2005 for InspIRCd by  doxygen 1.4.4-20050815
-- cgit v1.3.1-10-gc9f91