l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Apr 15 10:37

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] TCP and Linux
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] TCP and Linux

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 15, 2003 at 09:04:57AM -0700, Rod Roark wrote:
> On Tuesday 15 April 2003 08:38 am, Mike Simons wrote:
> > On Mon, Apr 14, 2003 at 09:13:55PM -0700, Rod Roark wrote:
> > > Someone I know runs a game server daemon but doesn't have
> > > the source for it.  It has a bug that I suspect comes from
> > > doing send() calls to a nonblocking socket without checking
> > > for a buffer-full condition.  Therefore some sent data is
> > > lost.
> >
> > - Is the binary dynamicly linked against libc.so?
> >   (send output from ldd /path/to/binary)
> Um, probably as that's the compiler default.  Email turnaround
> from this admin is a bit slow.  Where is this question headed?
> I don't think a suggestion of recompiling glibc will get far.
> :-)

  It is not too tricky to write a little C code which pretends to be
libc for the functions socket/connect/send, which acts as a wrapper for
the around the real functions... doing a little book keeping and then
calling the real libc functions.

  You put this library in your LD_LIBRARY_PATH or LD_PRELOAD environment
variables before running the binary in question and you can replace those=
system calls with whatever you want.  In reality you would run setsockopt=
calls to increase the buffer and maybe do something fancy if the send=20
call returns a partial write.

  I've taken this approach to work around a few bugs in a Oracle OCI=20
library that the development team at Oracle decided not to fix.

I can put together an example snip of code ...=20
- explain what you want done at socket creation time?=20
  (are sockets incoming or outgoing)
- what do you want done if send a partial buffer happens?
  (queue on a buffer to send next before send, block waiting for
   send to work, return error, etc...)

GPG key: http://simons-clan.com/~msimons/gpg/msimons.asc

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org


vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.