Alaska Software Inc. - ASINET SocketRecv(
Username: Password:
AuthorTopic: ASINET SocketRecv(
Jim GrahamASINET SocketRecv(
on Tue, 28 Jan 2003 15:06:06 -0500
have a program that is doing TCP/IP communications using the ASINET
library.  The program will send a command to a socket, and then wait for a
reply (Success/Fail)  The program will on occasion "Hang", and when I Alt-C
the program, the XPPFATAL.log always points the the line:

SocketRecv( lnSocket, @lcRECVBUFFER, lnBUFFERLEN, MSG_NORMAL )


My question is, does the SocketRecv have any timeout, or does it just keep
listening forever??

Regards,

--
Jim Graham
V.P. of Software Development
Professional Teledata
jgraham@proteledata.com
http://www.proteledata.com
phil@compucar.net Re: ASINET SocketRecv(
on Wed, 29 Jan 2003 10:36:39 +0000
>My question is, does the SocketRecv have any timeout, or does it just keep
>listening forever??

It listens forever, unless you set the socket to non-blocking mode.
In non-blocking mode, it will check to see if there is any data
pending.  If data is available, it will read it and return it in the
buffer, otherwise it will return anyway.

Regards,

Phil Ide

Xbase++ FAQ
current release: 8,  Monday 4th February 2002, 14:54
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***
Clyde AnnachRe: ASINET SocketRecv(
on Wed, 29 Jan 2003 08:45:45 -0500
Hi Phil,

A quick follow up question if you will.

Who, the Client or the Server or Both,  defines the socket as non blocking?

TIA

Clyde

"Phil Ide" <phil@compucar.net> wrote in message
news:3e37ae6b.4334032@news.alaska-software.com...
> >My question is, does the SocketRecv have any timeout, or does it just
keep
> >listening forever??
>
> It listens forever, unless you set the socket to non-blocking mode.
> In non-blocking mode, it will check to see if there is any data
> pending.  If data is available, it will read it and return it in the
> buffer, otherwise it will return anyway.
>
> Regards,
>
> --
> Phil Ide
>
> Xbase++ FAQ
> current release: 8,  Monday 4th February 2002, 14:54
> ***
> * Xbase++ FAQ:
> *  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
> *          : www.software-braun.de/xbfaq/xbfaq.htm
> *  download: http://www.idep.org.uk/xbase/xbfaq.zip
> *          : www.software-braun.de/xbfaq/xbfaq.zip
> ***
phil@compucar.net Re: ASINET SocketRecv(
on Wed, 29 Jan 2003 14:40:11 +0000
Hi Clyde,

>A quick follow up question if you will.
>
>Who, the Client or the Server or Both,  defines the socket as non blocking?

Each end of the socket/pipe has it's own set of attributes.
Therefore, one end can be blocking and the other non-blocking.

Blocking/Non-Blocking defines the behaviour of the read mechanism, not
the behaviour of the pipe/socket.

Regards,

Phil Ide

Xbase++ FAQ
current release: 8,  Monday 4th February 2002, 14:54
***
* Xbase++ FAQ:
*  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
*          : www.software-braun.de/xbfaq/xbfaq.htm 
*  download: http://www.idep.org.uk/xbase/xbfaq.zip
*          : www.software-braun.de/xbfaq/xbfaq.zip 
***
Clyde AnnachRe: ASINET SocketRecv(
on Wed, 29 Jan 2003 09:51:17 -0500
Thanks Phil,

That clears things up immensely.

Clyde

"Phil Ide" <phil@compucar.net> wrote in message
news:3e37e682.18692858@news.alaska-software.com...
> Hi Clyde,
>
> >A quick follow up question if you will.
> >
> >Who, the Client or the Server or Both,  defines the socket as non
blocking?
>
> Each end of the socket/pipe has it's own set of attributes.
> Therefore, one end can be blocking and the other non-blocking.
>
> Blocking/Non-Blocking defines the behaviour of the read mechanism, not
> the behaviour of the pipe/socket.
>
> Regards,
>
> --
> Phil Ide
>
> Xbase++ FAQ
> current release: 8,  Monday 4th February 2002, 14:54
> ***
> * Xbase++ FAQ:
> *  online  : http://www.idep.org.uk/xbase/xbfaq/xbfaq.htm
> *          : www.software-braun.de/xbfaq/xbfaq.htm
> *  download: http://www.idep.org.uk/xbase/xbfaq.zip
> *          : www.software-braun.de/xbfaq/xbfaq.zip
> ***