home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!info-multinet
- From: adelman@TGV.COM (Kenneth Adelman)
- Newsgroups: vmsnet.networks.tcp-ip.multinet
- Subject: Re: porting Unix code to Multinet
- Message-ID: <921217161816.42400128@TGV.COM>
- Date: Thu, 17 Dec 92 16:19:59 PST
- Organization: Info-Multinet<==>Vmsnet.Networks.Tcp-Ip.Multinet Gateway
- X-Gateway-Source-Info: Mailing List
- Lines: 32
-
- > I'm in the process of porting some moderately complex Unix networking
- > code to Multinet and would like to solicit some advice from the
- > community. My problem is with socket_*().
-
- > The code I'm working with makes the assumption that local fds (generated
- > by VAXC open()) and remote sockets (generated by Multinet 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? One approach is presumably to use the UCX emulation, where read(),
- > close(), and write() all take either sockets or fds. Is there any
- > downside to that?
-
- > My options seem to be (0) to use the UCX emulation, (1) to duplicate the
- > library routines, and have the high level routines call the net- version
- > of the library if appropriate, (2) [almost equivalent] to add flag
- > parameters or global variables to communicate whether a particular int
- > refers to a VAXC fd or a TGV socket, or (3) to decide in the low level
- > routine what a particular int refers to (in Wollongong code, I can use
- > the kludge that fds are sequentially assigned and so are very small ints,
- > whereas sockets are >= 192). What's my best bet?
-
- I'd go with a variant of (2). They are all practical solutions, which
- is best depends on the complexity of the code and how willing you
- are to modify it.
-
- You could, instead of passing around "fds", pass around pointers
- to your own structure which contains the real fd and the type of fd.
- The library routines can examine the flag and know which routines to
- expect.
-
- Ken
-