In article <FB30E6123B22D211B52800A0C9CFBB19010C0E9F@LONES2>, "BAZLEY, Sebastian" 
<[EMAIL PROTECTED]> writes:
> On VMS, syswrite() returns undef if one tries to write more than 65535 bytes
> on a socket.

Probably to more devices than just a socket; my bet is that any
non-file-structured device would have the problem.

As should be obvious, this is the (in)famous "length as an unsigned short"
in QIO calls.  Perl calls the CRTL `write' function which does the QIO.

> This can cause problems for other modules, so how about forcing the call to
> write a maximum of 65535 bytes? [The caller should always be prepared to
> handle a shorter write, so this should not break any code.]

Should, but watch out; I've seen plenty of unix code with:

    if (write(fd, buf, n) != n)  {die_horribly}

> It seems to me that undef should be reserved for more "serious" errors.
>
> Anyone agree/disagree/other solutions?
>
> [This problem showed up on VMS 7.2-1 with UCX 5.0A. I have not tried any
> other combinations.]

Watch out though, if you just break at a random place it's possible you'll
have problems with carriage control bytes.

For example in Perl if you do a print to a mailbox:

    print MBX "blah blah\n";

The "\n" is stripped (by the CRTL) before writing to the mailbox.  If
you read from a mailbox, a "\n" is tacked on the end of the record by
the CRTL before Perl gets the data.

My *bet* is that you want to break at \n bytes, but you'll have to try
it and see.
--
 Drexel University       \V                     --Chuck Lane
----------------->--------*------------<[EMAIL PROTECTED]
     (215) 895-1545      / \  Particle Physics  [EMAIL PROTECTED]
FAX: (215) 895-5934        /~~~~~~~~~~~         [EMAIL PROTECTED]

Reply via email to