DIRECTORY BufferDefs USING [OisBuffer], OISCPTypes USING [WaitTime], NSAddress USING [NetworkAddress]; Socket: DEFINITIONS = BEGIN ChannelHandle: TYPE = REF ChannelObject; ChannelObject: TYPE; TransferStatus: TYPE = { pending, goodCompletion, aborted, noRouteToNetwork, hardwareProblem, invalidDestAddr, noAnswerOrBusy, -- auto-dial case only noTranslationForDestination, -- no phone number for this destination circuitInUse, -- being used to talk to another destination circuitNotReady, -- dial the phone or connect modems (non-auto-dial case) noDialingHardware, dialerHardwareProblem}; SocketStatus: TYPE = RECORD [ localAddr: NSAddress.NetworkAddress, state: State, incompleteGets: CARDINAL]; State: TYPE = {active, aborted}; WaitTime: TYPE = OISCPTypes.WaitTime; -- msecs uniqueNetworkAddr: READONLY NSAddress.NetworkAddress; defaultWaitTime: WaitTime = 60000; -- msecs maxInternetOISPktLength: CARDINAL = 576; -- in bytes and includes header AssignNetworkAddress: PROCEDURE RETURNS [NSAddress.NetworkAddress]; Create: PROCEDURE [ local: NSAddress.NetworkAddress, send: CARDINAL _ 1, receive: CARDINAL _ 2, -- maximum no. of receive buffers used at one time reserve: CARDINAL _ 0, -- more buffers can be allocated but not used privateBuffers: BOOLEAN _ TRUE] RETURNS [ChannelHandle]; Delete: PROCEDURE [cH: ChannelHandle]; Abort: PROCEDURE [cH: ChannelHandle]; Reset: PROCEDURE [cH: ChannelHandle]; GetStatus: PROCEDURE [cH: ChannelHandle] RETURNS [SocketStatus]; SetWaitTime: PROCEDURE [cH: ChannelHandle, time: WaitTime]; PutPacket: PROCEDURE [cH: ChannelHandle, b: BufferDefs.OisBuffer]; PutPacketToAllConnectedNets: PROCEDURE [cH: ChannelHandle, b: BufferDefs.OisBuffer]; -- this procedure broadcast a packet to all hosts on all locally connected nets. The user only need supply the destination socket number of the packet. GetPacket: PROCEDURE [cH: ChannelHandle] RETURNS [b: BufferDefs.OisBuffer]; TimeOut: ERROR; -- error when timeout ocurrs on blocked call like TransferWait ChannelAborted: ERROR; -- error when state is aborted ChannelError: ERROR; END. LOG (trimmed to Teak) Time: January 22, 1980 8:57 PM By: Dalal Action: modified SocketStatus. Time: January 26, 1980 10:12 AM By: Dalal Action: made ChannelHandle LONG. Time: March 11, 1980 3:21 PM By: BLyon Action: Put, Get use PhysicalRecordHandles instead of CrateHandles. Added Reset. Time: June 18, 1980 2:23 PM By: BLyon Action: use NSAddress instead of NSAddress; uniqueNetworkAddr from CONSTANT to READONLY, ChannelHandle & GetHandle are opaque types. Time: August 6, 1980 10:17 AM By: Garlick Action: Added several TransferStatus's for circuit-oriented network errors. Time: October 10, 1980 4:50 PM By: Garlick Action: Added TransferStatus noAnswerOrBusy Time: January 6, 1981 2:21 PM By: BLyon Action: Post Mokelumne rework. Socket.Mesa Copyright c 1985 by Xerox Corporation. All rights reserved. BLyon on: January 27, 1981 5:10 PM definitions various types used by socket channels. the following apply to circuit-like media only and mostly to the first packet sent constants used by the client. interface exported by SocketImpl. procedures maximum no. of send buffers used at one time True => the buffers will be ALLOCATED for this channel; False => buffers will be shared will the system's buffers (and no new buffers will be allocated; examples of these are the EchoServer and NetworkStream Listeners). Be careful - False values can deadlock the system; users should only use one buffer at a time and return it asap without trying to grab other resources (or other buffers). sending and receiving packets - they are in real buffers asynchronous, return is immediate; when the buffer is finally sent the dispatcher calls b.requeueProcedure[b] to relinquish system ownership of the buffer. If the error ChannelAborted ocurs then the caller still own the buffer, b. This procedure does not attemp to broadcast a packets to ALL nets; use PutPacketToAllConnectedNets for that. this waits - for a packet to arrive or a TimeOut or an ChannelAborted. errors error when bad software structuring, or bad parameter to calls Κ˜codešœ ™ Kšœ Οmœ1™˜NKšœžœŸ˜5Kšœžœ˜Kšœ>™>K˜Kšžœ˜K˜—Kšž˜K˜K˜Kšœžœ+˜JKšœžœ(žœ˜MKšœžœ^˜{Kšœžœ8˜TKšœžœžœ-˜XKšœžœZ˜xKšœžœ;˜ZKšœžœ+˜IK˜K˜—…— I