|
From: David B <de...@so...> - 2001-02-01 19:30:28
|
Sorry for the delay in replying.
>> Hi, I'm having a problem with the tcp part of icqlib.
>>
>> I can do everything on the UDP side of things, receive msg's, send
>> messages (through the server) etc. However if I enable tcp, messages
>> sent to me just time out and never appear. However if I message the
>> person (ICQ_SEND_DIRECT) then I can get msg's from the person.
>>
>> I have the socket handler stuff set up and it seems to be working ok.
>>
>> I also have the same problem if I call icq_Main on a 100ms timer.
>>
>> Have I not set up something vital?
>
>It sounds like you're doing everything correctly. The socket handler
>callback is only there as an option - icqlib should work the same as it
>used to if you're using the timer method to call icq_Main, it's just
>going through my new socket manager code.
>
>I've been getting a number of different reports for this lately, but
>on my local system here, everything appears to work fine in both
>directions. If you could, please do the following:
>
>1. Ensure you've updated to the most recent CVS version - I put a few
>fixes in for the socket manager code after my initial checkin.
Yep it's the latest.
>
>2. Use the icq_Log callback to capture a log. Log everything that
>comes across the callback, try to send a TCP message to your program.
>Send me the resulting output.
I did this, and the log was working fine, logging everything. However
when sending a TCP message, nothing is logged, it just plain doesn't
see it. So I didn't bother attaching the log as it shows nothing about
the tcp message or any errors about it. Let me know if you still want
it however.
>
>3. Give me a quick description of your system, running uname -a at a
>shell prompt is fine.
I probably should have mentioned this is a win32 machine and not a unix
machine, and there no doubt lies the problem.
I do however remember something that is no doubt the cause of this (and
therefore my fault). When compiling icqlib (socketmanager.c to be
precise) I got an error about no socklen_t. I quickly checked the
winsock headers and saw that the function being passes a socklen_t
variable was 'int' in the headers and so I changed it to int and
everything compiled fine, I didn't think much of it. However looking
again, the function is what ACCEPTS connections in the first place I
believe.
int icq_SocketAccept(int listens, struct sockaddr *addr, socklen_t
*addrlen) {
int s = accept(listens, addr, addrlen);
icq_SocketAlloc(s);
return s;
}
In the headers I have, accept is defined as:
SOCKET PASCAL accept(SOCKET,struct sockaddr *,int *);
Hence why I changed socklen_t for int. However I guess this wasn't a
good thing to do.
However I had the same tcp problem with icqlib1.0 and don't remember
any socklen_t changing in there. Or in fact changing anything. I
guess it's a winsock problem if it's working ok for you on a unix based
system.
David
|