l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
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



--2fjX3cMESU3XgGmZ
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)
>=20
> 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=
=20
system calls with whatever you want.  In reality you would run setsockopt=
=20
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...)

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

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

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

iD8DBQE+nDl94Qwkn7f6rL4RAqw7AJwJHnIySNmhIRACAo7zlIU6o5UglwCglUeK
Nyd1+wlgvot7/L0muZF02Fs=
=xZ+s
-----END PGP SIGNATURE-----

--2fjX3cMESU3XgGmZ--
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech








LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
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:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.