cleanup...now the xmpp thread will not suck your cpu
This commit is contained in:
parent
556436ef77
commit
c92a7038d0
|
@ -191,7 +191,7 @@ status_t
|
|||
MSNP::Process(BMessage* msg)
|
||||
{
|
||||
// printf("Process()\n");
|
||||
msg->PrintToStream();
|
||||
// msg->PrintToStream();
|
||||
|
||||
switch (msg->what) {
|
||||
case IM_MESSAGE:
|
||||
|
@ -314,6 +314,7 @@ MSNP::Process(BMessage* msg)
|
|||
y = x;
|
||||
} else {
|
||||
delete fSwitchboardList.ItemAt(x)->second;
|
||||
//delete fSwitchboardList.ItemAt(x)->first;
|
||||
fSwitchboardList.RemoveItemAt(x);
|
||||
}
|
||||
break;
|
||||
|
@ -1066,7 +1067,7 @@ int MSNP::listenOnPort(int port)
|
|||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(port);
|
||||
addr.sin_port = htons((uint16)port);
|
||||
|
||||
if (bind(s, (sockaddr *)(&addr), sizeof(addr)) < 0 || listen(s, 1) < 0) {
|
||||
close(s);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
static status_t
|
||||
connect_thread(void* data)
|
||||
{
|
||||
|
||||
JabberHandler* handler = (JabberHandler*)data;
|
||||
if (!handler)
|
||||
return B_BAD_VALUE;
|
||||
|
@ -34,7 +35,7 @@ connect_thread(void* data)
|
|||
return B_BAD_VALUE;
|
||||
|
||||
gloox::ConnectionError e;
|
||||
while ((e = client->recv(1000)) == gloox::ConnNoError);
|
||||
while ((e = client->recv(10000000)) == gloox::ConnNoError);
|
||||
|
||||
if (e != gloox::ConnUserDisconnected)
|
||||
handler->HandleError(e);
|
||||
|
|
Ŝarĝante…
Reference in New Issue