adding missing includes; trivial fix - comparison with string literal. by
[centerim.git] / libicq2000 / src / SocketClient.cpp
blobfdf36db2a1ec326e8220341bfb257d49cc380394
1 /*
2 * SocketClient
4 * Copyright (C) 2001 Barnaby Gray <barnaby@beedesign.co.uk>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "SocketClient.h"
24 #include "sstream_fix.h"
26 using std::string;
28 namespace ICQ2000 {
30 void SocketClient::SignalAddSocket(int fd, SocketEvent::Mode m) {
31 AddSocketHandleEvent ev( fd, m );
32 socket.emit(&ev);
35 void SocketClient::SignalRemoveSocket(int fd) {
36 RemoveSocketHandleEvent ev(fd);
37 socket.emit(&ev);
40 void SocketClient::SignalLog(LogEvent::LogType type, const string& msg) {
41 LogEvent ev(type,msg);
42 logger.emit(&ev);
45 int SocketClient::getfd() const { return m_socket->getSocketHandle(); }
47 TCPSocket* SocketClient::getSocket() const { return m_socket; }
49 void SocketClient::setClientBindHost(const std::string &host) { m_bindhost = host; }
51 // -- exceptions ------------------------------------------------------------
53 SocketClientException::SocketClientException() { }
54 SocketClientException::SocketClientException(const string& text) : m_errortext(text) { }
56 const char* SocketClientException::what() const throw() { return m_errortext.c_str(); }
58 DisconnectedException::DisconnectedException(const string& text) : SocketClientException(text) { }