home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: vmsnet.networks.tcp-ip.wintcp
- Path: sparky!uunet!eco.twg.com!eco.twg.com!larry
- From: larry@eco.twg.com (Lawrence B. Henry III)
- Subject: Re: porting Unix code to Wollongong
- Message-ID: <1992Dec17.160019.12647@eco.twg.com>
- Lines: 70
- Sender: larry@vishnu.eco.twg.com (Lawrence B. Henry III)
- Nntp-Posting-Host: eco.twg.com
- Reply-To: larry@eco.twg.com
- Organization: The Wollongong Group (East Coast Operations)
- References: <1gocceINN124@pith.uoregon.edu>
- Date: Thu, 17 Dec 92 16:00:19 GMT
- Lines: 70
-
-
- In article <1gocceINN124@pith.uoregon.edu>, jqj@duff.uoregon.edu (JQ
- Johnson) writes:
- |>Path:
- |
- eco.twg.com!uunet!usc!rpi!usenet.coe.montana.edu!news.u.washington.edu!n
- news.uoregon.edu!duff.uoregon.edu!jqj
- |>From: jqj@duff.uoregon.edu (JQ Johnson)
- |>Newsgroups: vmsnet.networks.tcp-ip.wintcp
- |>Subject: porting Unix code to Wollongong
- |>Date: 16 Dec 1992 22:59:26 GMT
- |>Organization: University of Oregon Network Services
- |>Lines: 31
- |>Distribution: world
- |>Message-ID: <1gocceINN124@pith.uoregon.edu>
- |>NNTP-Posting-Host: duff.uoregon.edu
- |>
- |>I'm in the process of porting some moderately complex Unix networking
- |>code to Wollongong, and would like to solicit some advice from the
- |>community. My problem is with netread(), netwrite(), and netclose().
- |>
- |>The code I'm working with makes the assumption that local fds
- |>(generated
- |>by VAXC open()) and remote sockets (generated by Wollongong socket())
- |>can be treated equivalently. For instance, there are library
- |>routines that accept either and (sometimes after several levels of
- |>subroutine) call read() or write() to perform the I/O. What's the
- |>best way to port such code?
- |>
- |>My options seem to be (1) to duplicate the library routines, and have
- |>the
- |>high level routines call the net- version of the library if
- |>appropriate,
- |>(2) [almost equivalent] add flag parameters or global variables to
- |>communicate whether a particular int refers to a VAXC fd or a TWG
- |>socket,
- |>or (3) to decide in the low level routine what a particular int refers
- |>to.
- |>What's my best bet?
- |>
- |>In particular, is there any reliable way to distinguish between a fd
- |>and a
- |>socket? I notice that VAXC, like most Unixes, returns small
- |>sequential
- |>ints for fds; Wollongong appears to return user memory addresses,
- |>e.g.
- |>280, 284, etc., so a gross check on value would appear to be
- |>possible.
- |>
- |>By the way, I have the same questions as the above for Multinet. UCX
- |>presumably is not a problem in this regard.
- |>
- |>--
- |>JQ Johnson Office: 250E Computing Center
- |>Director of Network Services Internet: jqj@ns.uoregon.edu
- |>Computing Center, Univ. of Oregon voice: (503) 346-1746
- |>Eugene, OR 97403-1212 fax: (503) 346-4397
- |>
- JQ,
- You might try one of two approaches.. the most clean approach is to
- get our UCX emulation and just use the C RTL.. This is coming out with our
- new release of PathWay for VMS... but given you don't want to wait for an
- upgrade you might want to try doing a MSG_PEEK QIO (IO$_RECEIVE) on a potential
- FD prior for every operation and if you receive the SS$_BADPARAM error.. assume that you
- have a FD and use the C RTL otherwise assume that you have a socket
- and follow those rules.. You will pay a performance penalty.. but it
- should give you a fairly simple port. ie, write your own read(), write() and
- close() functions which either call netread() or real read()..
-
- -Larry.
-