tcp socket ERROR 4687 in plua 2.0b7

View: New views
8 Messages — Rating Filter:   Alert me  

tcp socket ERROR 4687 in plua 2.0b7

by bugmenot4711 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.


RE: tcp socket ERROR 4687 in plua 2.0b7

by Blake Winton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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.

Re: tcp socket ERROR 4687 in plua 2.0b7

by bugmenot4711 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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?


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

by Blake Winton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > (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.

Re: tcp socket ERROR 4687 in plua 2.0b7

by bugmenot4711 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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



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

by Cameron Kaiser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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 * ckaiser@...
-- FORTUNE: Today is a great day for making firm decisions. Or is it? ---------

Re: tcp socket ERROR 4687 in plua 2.0b7

by bugmenot4711 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.


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

by Cameron Kaiser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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 * ckaiser@...
-- I may have invented CtrlAltDel, but Microsoft made it popular. -- D. Bradley