Wip_write returns zero


#1

hi,

i have a problem about sending data throgh tcp/ip. i use wip lib. when a client connects to my modem, i send some data to the client . this data about 12000 bytes and i send this with a timer interval of 1 seconds. i send 400 bytes every seconds by this timer.

now, my problem is sometimes i can not send this data with wip_write function. it returns zero that means it cant send any data at that time. then i wait for the next second and try to send again. usually i can not send along 30 seconds. when i get WIP_CEV_WRITE event, i can send again but it is too late.

my question is , how can i decrease this 30 seconds time so that my client wont think that timeout hapenned?
i search for SEND_LOWAT, RCV_LOWAT and WIP_COPT_NODELAY option but i count have an idea if these can solve my problem or not.


#2

You can check transmit buffer for more info on your problem. The command to check it will be something like:
wip_getOpts(socket, WIP_COPT_SND_BUFSIZE, &allbuf, WIP_COPT_NWRITE, &freebuf, WIP_COPT_END);

When buffer is not full it is OK to send more data.


#3

thank you for the reply, i will try for it. Or i will use an other way to solve this problem.


#4

I’m using OASIS 2.10, with the Q2687G, and I tried using this feature to work around another WIP issue. What I got is that WIP_COPT_NWRITE returns some random number in the 4 million range. Wavecom has confirmed this is broken. As an aside, I also noticed that Readable and Writeable (part of the WIP Event data structure) is always “0”.

blackyblack has NWRITE worked for you before?


#5

Yes, WIP_COPT_NWRITE perfectly works. However I use OpenAT 4.26, WIP 3.x and q2686 (with q24 works fine too).