SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.

The Southern California OS/2 User Group
USA

SCOUG-Programming Mailing List Archives

Return to [ 02 | June | 1998 ]

<< Previous Message << >> Next Message >>


Date: Tue, 2 Jun 1998 11:47:18 PST8PDT
From: "Gregory W. Smith" <gsmith@well.com >
Reply-To: scoug-programming@scoug.com
To: < "scoug-programming@scoug.com" > scoug-programming@scoug.com >
Subject: SCOUG-Programming: GetLine()

Content Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

On Tue, 2 Jun 1998 09:44:36 PST8PDT, Steven Levine wrote:

>Time for my 2cents. The above only fixes part of the problem and can
>return a buffer without and NL to the caller. The "specifications" don't
>say if the caller must handle this.

That was the obvious problem that I referred to. A slow typist could
cause the send command to be invoked more than twice depending
on the client. Type the command.... Go look up the options. Type
the options.... Go look at a file listing. Type the file name.... Answer the
phone. Then hit return. It is conceivable that send() could be invoked
during each pause.

>
>char *GetLine(int Socket){
>
> static char Buffer[4096];
> int rc = 0;
> int offset = 0;
>
> while (rc >= 0 && offset < sizeof(Buffer)){
>
> rc = recv (Socket, Buffer + offset, sizeof (Buffer) - offset,
>0);
>
> if (rc > 0) {
> if ( '\n' == Buffer[offset+rc-1] )
> return Buffer;
> else
> offset += rc;
> }
> }
>
> return NULL; /* No NL or recv failed */
>}
>
>What's left is to decide how many times we allow recv to return no data
>before giving up.
>
>Steven
>
>--
>-----------------------------------------------------------
>Steven Levine MR2/ICE #10183
>-----------------------------------------------------------

===============================================================
Gregory W. Smith (WD9GAY) gsmith@well.com
finger gsmith@well.com for PGP public key
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNXRdlDtML4mvizAhAQEc6AQAvZkSZG0w7755yxCGCJvCSQoGCTZpp6AX
nBdvnv43B85ugWkZIPD4AqruDnomUASUv2gYVzjCF+JP/qNVci+dG/q/RKxH1flk
MMw7G0ho+No3N79P0I/8oyPiug3nANNQxk03idvjzQXEh+cWPhrNJb8Zyizm7DGp
r5julTWoOQw=
=idpw
-----END PGP SIGNATURE-----

=====================================================

To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".

For problems, contact the list owner at
"rollin@scoug.com".

=====================================================


<< Previous Message << >> Next Message >>

Return to [ 02 | June | 1998 ]



The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA

Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS RESERVED.

SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group. OS/2, Workplace Shell, and IBM are registered trademarks of International Business Machines Corporation. All other trademarks remain the property of their respective owners.