Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

poslib/server/serverthread.h

Go to the documentation of this file.

  
00001 /* 00002 Posadis - A DNS Server 00003 The main server thread 00004 Copyright (C) 2002 Meilof Veeningen <> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __POSLIB_SERVER_SERVERTHREAD_H 00022 #define __POSLIB_SERVER_SERVERTHREAD_H 00023 00024 #include 00025 00026 #include <poslib/socket.h> 00027 #include 00028 #include <poslib/postime.h> 00029 00030 #include "pending.h" 00031 00039 enum sstype { 00040 ss_udp, 00041 ss_tcp, 00042 ss_client 00043 }; 00044 00046 void udpsock_handledata(int sockid); 00048 void tcpsock_handledata(int sockid); 00050 void clientsock_handledata(int sockid); 00051 00058 class ServerSocket { 00059 public: 00067 ServerSocket(sstype type, int sockid); 00068 ~ServerSocket(); 00070 void close(); 00071 void handle_data(); 00073 sstype type; 00074 int sockid; 00075 }; 00076 00078 extern pthread_mutex_t m_servers; 00079 #if defined(_WIN32) && !defined(BUILD_POSD_DLL) 00080 extern __declspec(dllimport) stl_slist(ServerSocket) servers; 00081 #else 00083 extern stl_slist(ServerSocket) servers; 00084 #endif 00085 00087 extern pthread_mutex_t m_pending_answers; 00089 extern stl_slist(PendingAnswerUDP) pending_answers; 00090 00092 extern pthread_cond_t c_data_received; 00093 00094 extern int udp_client_socket; 00095 extern int udp_client_socket_6; 00097 int getclientsockid(_addr *a); 00099 void *serverthread(void *arg); 00114 extern bool(*allow_tcp_connection)(_addr *a, int ntcp); 00115 00121 extern int n_threads; 00122 00137 extern void(*user_cleanup_function)(void); 00138 00145 void posserver_init_srvresolver(); 00146 00153 void posserver_startback(); 00154 00162 void posserver_run(); 00163 00172 void posserver_stop(); 00173 00174 #endif /* __POSLIB_SERVER_SERVERTHREAD_H */

  
Generated on Fri Dec 24 19:55:14 2004 for Poslib by doxygen 1.3.7