[comp.protocols.tcp-ip] socket connection to printer

nomann@rimfaxe.diku.dk (Ole Nomann Thomsen) (04/09/90)

Hello, I need some help on this:

Configuration (probably more data than needed here):
Xenix 386, Excelan 3.5 Netsoftware
CS200 Connectionserver runnning SW/200-TCP-NCS/AT Vers. 3.2
One mannesman laserprinter connected to the former, 9600 Baud, Xon-Xoff.

I have a program, that sends to the printer, via the network. It works
by connecting a TCP stream socket to a port on a CS200 connection-server,
and sending the data throught that.

Problem:
If I just send the data, and then close down the connection, some data is
lost. (Probably the data, that was "in transit" when I closed). This
happends _Even_though_ the SIOCGLINGER-ioctl() call returns 0xFFFF, which 
is supposed to mean that the connection stays open until all data has been
acknowledged.

Temporary solution:
If I execute a sleep(60) (that is sleep one minute, not sleep from man60 :-)
before closing the socket, this prevents data-loss _except_ in large and com-
plicated printjobs. (I suppose sleep(120) might do the trick then)
				This is not satisfying, since it forces a one-minute break between
print-jobs, and still fails sometimes.

Appeal:
Can anybody help me on this ? I have read the FM quite a lot of times, and
made some experiments, I only post this as a last resort. If you email me the
answer, I shall post a summary. Thank you very much.
"Very good". - Johan Gambolsputty De Von AusFernSplendenSchlitterCrasCrenBonFriediggerDingleDangleDongleDungleBursteinVonKnackerThrasherAppelbangerHorowitzTicolensicGranderKnottySpelltinklerGrandlichGrumblemeyerSpelterwasserKurstlichHimble
EisenBahnWagenGutenabenBitteEineNurnburgerBratwurstleGespurtenMitzWeimachelUberHundsfutGumberaberSchonendankerKalbsFleischMittlerAuche Von Hautkopf of Ulm.