00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __NET_H__
00022 #define __NET_H__
00023 #include <util/utilException.h>
00024
00025 namespace Spm
00026 {
00027 namespace Util
00028 {
00029
00030 class NetException : public Exception
00031 {
00032 public :
00033 NetException (const std::string & errMsg);
00034 };
00035
00036 typedef struct
00037 {
00038 std::string service;
00039 std::string host;
00040 std::string pathToFile;
00041 std::string userName;
00042 std::string password;
00043 int port;
00044 }urlDetails;
00045
00052 int getSocket (const std::string & host,
00053 int port)
00054 throw (NetException);
00055
00060 void closeSocket (int & fdSocket);
00061
00067 void sendTo (int fdSocket,
00068 std::string & str)
00069 throw (NetException);
00070
00077 char * recv(int fdSocket,
00078 int & size)
00079 throw (NetException);
00080
00086 urlDetails parseUrl (const std::string & url)
00087 throw (NetException);
00088
00094 int getDefaultPortByService(const std::string & serviceName);
00095
00101 bool isUrl (const std::string & str);
00102 }
00103 }
00104 #endif