error_write.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 CONEXUSWRITE_ERROR_H
00020 #define CONEXUSWRITE_ERROR_H
00021 
00022 #include <conexus/error.h>
00023 
00024 namespace Conexus
00025   {
00026 
00032   class write_error: public conexus_error
00033     {
00034     public:
00035       write_error(int e=0): conexus_error("Unknown error, write failed.",e,"write")
00036       { }
00037       write_error(const std::string s, int e=0): conexus_error(s,e,"write")
00038       { }
00039     }
00040   ;
00041 
00042   namespace error
00043     {
00044 
00045     namespace write
00046       {
00047 
00055       class would_block: public write_error
00056         {
00057         public:
00058           would_block(): write_error("The socket is marked non-blocking and  the  requested  operation would block.", EWOULDBLOCK)
00059           { }
00060         }
00061       ;
00062 
00069       class bad_fd: public write_error
00070         {
00071         public:
00072           bad_fd(): write_error("sockfd is not a valid descriptor.", EBADF)
00073           { }
00074         }
00075       ;
00076 
00083       class connection_reset: public write_error
00084         {
00085         public:
00086           connection_reset(): write_error("Connection reset by peer.", ECONNRESET)
00087           { }
00088         }
00089       ;
00090 
00097       class destination_address_required: public write_error
00098         {
00099         public:
00100           destination_address_required(): write_error("The socket is not connection-mode, and no peer address is set.", EDESTADDRREQ)
00101           { }
00102         }
00103       ;
00104 
00105 
00112       class invalid_user_space_address: public write_error
00113         {
00114         public:
00115           invalid_user_space_address(): write_error("An invalid user space address was specified for a parameter.", EFAULT)
00116           { }
00117         }
00118       ;
00119 
00126       class interrupted: public write_error
00127         {
00128         public:
00129           interrupted(): write_error("A signal occurred before any data was transmitted.", EINTR)
00130           { }
00131         }
00132       ;
00133 
00134 
00141       class invalid_argument: public write_error
00142         {
00143         public:
00144           invalid_argument(): write_error("Invalid argument passed.", EINVAL)
00145           { }
00146         }
00147       ;
00148 
00157       class is_connected: public write_error
00158         {
00159         public:
00160           is_connected(): write_error("The connection-mode socket was connected already but a recipient was specified.", EISCONN)
00161           { }
00162         }
00163       ;
00164 
00165 
00173       class message_size: public write_error
00174         {
00175         public:
00176           message_size(): write_error("The  socket  type  requires that message be sent atomically, and the size of the message to be sent made this impossible.", EMSGSIZE)
00177           { }
00178         }
00179       ;
00180 
00181 
00192       class no_buffers: public write_error
00193         {
00194         public:
00195           no_buffers(): write_error("The output queue for a network interface was full.", ENOBUFS)
00196           { }
00197         }
00198       ;
00199 
00200 
00207       class no_memory: public write_error
00208         {
00209         public:
00210           no_memory(): write_error("No memory available.", ENOMEM)
00211           { }
00212         }
00213       ;
00214 
00221       class permission_denied: public write_error
00222         {
00223         public:
00224           permission_denied(): write_error("Permission denied.", EACCES)
00225           { }
00226         }
00227       ;
00228 
00235       class not_connected: public write_error
00236         {
00237         public:
00238           not_connected(): write_error("The socket is not connected, and no target has been given.", ENOTCONN)
00239           { }
00240         }
00241       ;
00242 
00249       class not_socket: public write_error
00250         {
00251         public:
00252           not_socket(): write_error("The argument s is not a socket.", ENOTSOCK)
00253           { }
00254         }
00255       ;
00256 
00257 
00265       class operation_not_supported: public write_error
00266         {
00267         public:
00268           operation_not_supported(): write_error("Some bit in the flags argument is inappropriate for  the  socket type.", EOPNOTSUPP)
00269           { }
00270         }
00271       ;
00272 
00273 
00282       class pipe: public write_error
00283         {
00284         public:
00285           pipe(): write_error("The  local  end  has  been  shut  down  on a connection oriented socket.", EPIPE)
00286           { }
00287         }
00288       ;
00289 
00298       class connection_refused: public write_error
00299         {
00300         public:
00301           connection_refused(): write_error("The connection has been refused. This is probably the result of an ICMP UNREACHABLE message, so the first few transmissions may have actually gone out before the ICMP UNREACHABLE message was processed. This probably means that the destination (host or port) doesn't exist or isn't active.", ECONNREFUSED)
00302           { }
00303         }
00304       ;
00305 
00311       class no_default_remote_address: public write_error
00312         {
00313         public:
00314           no_default_remote_address(): write_error("Socket cannot send because a default remote address has not been set.", -1)
00315           { }
00316         }
00317       ;
00318 
00324       class no_sendto_without_address: public write_error
00325         {
00326         public:
00327           no_sendto_without_address(): write_error("Socket is not capable of sendto without an address.", -1)
00328           { }
00329         }
00330       ;
00331 
00337       class not_opened: public write_error
00338         {
00339         public:
00340           not_opened(): write_error("Trying to write on I/O that cannot open.", -1)
00341           { }
00342         }
00343       ;
00344 
00350       class read_only: public write_error
00351         {
00352         public:
00353           read_only(): write_error("Trying to write to a read only I/O.", -1)
00354           { }
00355         }
00356       ;
00357 
00358 
00359     }
00360 
00361   }
00362 
00363 }
00364 
00365 #endif // CONEXUSSEND_ERROR_H

Generated on Sun Aug 6 12:16:57 2006 by  doxygen 1.4.6