debian/libconexus-dev/usr/include/conexus-0.5/conexus/except_bind.h

00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 #ifndef CONEXUSEXCEPT_BIND_H
00020 #define CONEXUSEXCEPT_BIND_H
00021 
00022 #include <conexus/except.h>
00023 
00024 namespace Conexus
00025   {
00026 
00032     class bind_exception: public conexus_exception
00033       {
00034       public:
00035       bind_exception(int e=0): conexus_exception("Unknown exception, socket cannot be bound.", e,"bind")
00036         { }
00037       bind_exception(const std::string s, int e=0): conexus_exception(s, e,"bind")
00038         { }
00039       }
00040     ;
00041 
00042   namespace exception
00043   {
00044 
00045   namespace bind
00046       {
00047 
00054       class bad_fd: public bind_exception
00055         {
00056         public:
00057           bad_fd(): bind_exception("sockfd is not a valid descriptor.", EBADF)
00058           { }
00059         }
00060       ;
00061 
00068       class bound_socket: public bind_exception
00069         {
00070         public:
00071           bound_socket(): bind_exception("The socket is already bound to an address.", EINVAL)
00072           { }
00073         }
00074       ;
00075 
00082       class access: public bind_exception
00083         {
00084         public:
00085           access(): bind_exception("The address is protected, and the user is not the super-user.", EACCES)
00086           { }
00087         }
00088       ;
00089 
00096       class not_socket: public bind_exception
00097         {
00098         public:
00099           not_socket(): bind_exception("Argument is a descriptor for a file, not a socket.", ENOTSOCK)
00100           { }
00101         }
00102       ;
00103 
00110       class invalid_address: public bind_exception
00111         {
00112         public:
00113           invalid_address(): bind_exception("The addrlen is wrong, or the socket was not in the AF_UNIX family.", EINVAL)
00114           { }
00115         }
00116       ;
00117 
00124       class read_only_filesystem: public bind_exception
00125         {
00126         public:
00127           read_only_filesystem(): bind_exception("The socket inode would reside on a read-only file system.", EROFS)
00128           { }
00129         }
00130       ;
00131 
00138       class segfault: public bind_exception
00139         {
00140         public:
00141           segfault(): bind_exception("addr points outside the user’s accessible address space.", EFAULT)
00142           { }
00143         }
00144       ;
00145 
00152       class name_too_long: public bind_exception
00153         {
00154         public:
00155           name_too_long(): bind_exception("addr is too long.", ENAMETOOLONG)
00156           { }
00157         }
00158       ;
00159 
00166       class not_exist: public bind_exception
00167         {
00168         public:
00169           not_exist(): bind_exception("The file does not exist.", ENOENT)
00170           { }
00171         }
00172       ;
00173 
00180       class no_kernel_memory: public bind_exception
00181         {
00182         public:
00183           no_kernel_memory(): bind_exception("Insufficient kernel memory was available.", ENOMEM)
00184           { }
00185         }
00186       ;
00187 
00194       class not_directory: public bind_exception
00195         {
00196         public:
00197           not_directory(): bind_exception("A component of the path prefix is not a directory.", ENOTDIR)
00198           { }
00199         }
00200       ;
00201 
00208       class loop: public bind_exception
00209         {
00210         public:
00211           loop(): bind_exception("Too many symbolic links were encountered in resolving addr.", ELOOP)
00212           { }
00213         }
00214       ;
00215 
00221       class no_address: public bind_exception
00222         {
00223         public:
00224           no_address(): bind_exception("cannot bind socket without an address.", -1)
00225           { }
00226         };
00227 
00233       class no_socket_bind: public bind_exception
00234       {
00235       public:
00236       no_socket_bind(): bind_exception("The Socket class bind method cannot be called without an address.", -1)
00237         { }
00238       };
00239 
00245       class not_open: public bind_exception
00246       {
00247       public:
00248       not_open(): bind_exception("Socket could not be opened for bind method.", -1)
00249         { }
00250       };
00251 
00252       }
00253 
00254   }
00255 
00256 }
00257 
00258 #endif // CONEXUSBIND_ERROR_H

Generated on Tue Mar 13 19:54:43 2007 by  doxygen 1.5.1