readyRead_();
}
-eString eSocket::readLine()
+std::string eSocket::readLine()
{
int size=readbuffer.searchchr('\n');
if (size == -1)
- return eString();
+ return std::string();
size++; // ich will auch das \n
char buffer[size+1];
buffer[size]=0;
readbuffer.read(buffer, size);
- return eString(buffer);
+ return std::string(buffer);
}
bool eSocket::canReadLine()
return socketdesc;
}
-int eSocket::connectToHost(eString hostname, int port)
+int eSocket::connectToHost(std::string hostname, int port)
{
struct hostent *server;
int res;
eSocket::eSocket(eMainloop *ml): readbuffer(32768), writebuffer(32768), rsn(0)
{
+ ASSERT(ml);
int s=socket(AF_INET, SOCK_STREAM, 0);
#if 0
eDebug("[SOCKET]: initalized socket %d", socketdesc);