tcp socket ERROR 4687 in plua 2.0b7

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

tcp socket ERROR 4687 in plua 2.0b7

bugmenot4711
Hi,

I'm currently experimenting with tcp sockets in Plua 2.0b7.
Sometimes a get an the ERROR 4687 when I attempt to open a
connection. But this error code isn't documented anywhere.
Or at least can't find it.

Does somebody know this error? What does it mean?

Thanks in advance.

Reply | Threaded
Open this post in threaded view
|

RE: tcp socket ERROR 4687 in plua 2.0b7

Blake Winton-3
> I'm currently experimenting with tcp sockets in Plua 2.0b7.
> Sometimes a get an the ERROR 4687 when I attempt to open a
> connection. But this error code isn't documented anywhere.
> Or at least can't find it.

A quick trip to http://prc-tools.sourceforge.net/errorcodes.html
shows us "4687 is netErrTooManyTCPConnections".

(If you think you're only opening and closing one connection,
 so you shouldn't run into this error, then I recommend you
 look up "netErrTooManyTCPConnections", and see what it says
 about SO_LINGER. :)

Later,
Blake.
Reply | Threaded
Open this post in threaded view
|

Re: tcp socket ERROR 4687 in plua 2.0b7

bugmenot4711
Hi again,

> (If you think you're only opening and closing one connection,
>  so you shouldn't run into this error, then I recommend you
>  look up "netErrTooManyTCPConnections", and see what it says
>  about SO_LINGER. :)

Thanks for your help, the SO_LINGER stuff is exactly the problem I
encounter.
Sorry to bother you again, but is there any way to modify this flag
in plua?

Reply | Threaded
Open this post in threaded view
|

RE: Re: tcp socket ERROR 4687 in plua 2.0b7

Blake Winton-3
> > (If you think you're only opening and closing one
> > connection,  so you shouldn't run into this error,
> > then I recommend you look up
> > "netErrTooManyTCPConnections", and see what it says
> > about SO_LINGER.  :)
>
> Thanks for your help, the SO_LINGER stuff is exactly
> the problem I encounter.  Sorry to bother you again,
> but is there any way to modify this flag in plua?

I have no idea, but if I had to guess, I would guess that
you'll need to write a C extension to add access to that
function, since it's not one of the things that most users
will need.  Or, you could politely ask M├írcio to just
always set it on sockets.  That's what I do when I write
Palm programs, because it doesn't seem to harm anything,
and it prevents this annoying limitation.

Later,
Blake.
Reply | Threaded
Open this post in threaded view
|

Re: tcp socket ERROR 4687 in plua 2.0b7

bugmenot4711
Okay, I feared this answer. But I think I'll try to write a library
with libkit.It shouldn't be very hard.

Thanks, you helped a lot


Reply | Threaded
Open this post in threaded view
|

Re: Re: tcp socket ERROR 4687 in plua 2.0b7

Cameron Kaiser
> Okay, I feared this answer. But I think I'll try to write a library
> with libkit.It shouldn't be very hard.

If you do this, please let me know. I'm in particular looking for a library
that has a timeout on connect (which plua's doesn't do), and I'm not handy
enough with libkit to whip one up myself.

--
--------------------------------- personal: http://www.armory.com/~spectre/ ---
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * [hidden email]
-- FORTUNE: Today is a great day for making firm decisions. Or is it? ---------
Reply | Threaded
Open this post in threaded view
|

Re: tcp socket ERROR 4687 in plua 2.0b7

bugmenot4711
In reply to this post by bugmenot4711
hello,

I've finished my library to access the Palm OS Net Lib.
It fixed my problem by setting the SO_LINGER flag, but introduced
some...

1. I can't export more than 5 functions from my library
   -> Palm performs a hard reset if I try to ... don't know why

2. My Plua program seems to big (about 2300 lines of code). The
library is loaded without problems.
But if I try to call a function from the library the Palm performs a
hard reset. Code of smaller sizes works perfectly...

So the library works, but is useless for me. If someone likes to use
it: no problem, the source is public domain.

If someone knows another way to set the SO_LINGER flag, please let me
know it.

bye.

Reply | Threaded
Open this post in threaded view
|

Re: tcp socket ERROR 4687 in plua 2.0b7

abm0000abm-2
--- In [hidden email], "bugmenot4711" <bugmenot4711@...> wrote:
>
> hello,
>
> I've finished my library to access the Palm OS Net Lib.

Hi,

Do you happen to have a compiled prc of your Plua networking library?

It could be very useful for a project I'm working on.

Also, I don't understand how I receive the actual HTTP response (not
just the HTML). The Plua network example does not seem to explain
that. When I send a "Get /", I just get the HTML back, not the HTTP
response.

Does anyone else know how this works?

Yours,
Kevin

Reply | Threaded
Open this post in threaded view
|

Re: Re: tcp socket ERROR 4687 in plua 2.0b7

Cameron Kaiser
> Also, I don't understand how I receive the actual HTTP response (not
> just the HTML). The Plua network example does not seem to explain
> that. When I send a "Get /", I just get the HTML back, not the HTTP
> response.

GET / is an HTTP/0.9 request and thus has no headers.

Try GET / HTTP/1.0\r\n\r\n (you may need a Host: header for some sites).

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * [hidden email]
-- I may have invented CtrlAltDel, but Microsoft made it popular. -- D. Bradley