-- SocketInternal.mesa (last edited by: BLyon on: January 9, 1981  2:50 PM
-- Function: The internal definitions module for Pilot Socket Channels.

DIRECTORY
  BufferDefs USING [BufferAccessHandle, QueueObject],
  Socket USING [ChannelHandle, State, WaitTime],
  SpecialSystem USING [NetworkAddress];

SocketInternal: DEFINITIONS SHARES BufferDefs =
  BEGIN OPEN Socket;

  -- definitions

  SocketHandle: TYPE = LONG POINTER TO SocketObject;
  SocketObject: TYPE = RECORD [
    next: SocketHandle, -- used only by the router
    -- every socket has a buffer pool, which is protected outside the socketRouterLock lock
    pool: BufferDefs.BufferAccessHandle,
    -- the buffer pool object if it is a private one
    -- socketRouterLock monitor protected data and condition variables
    localAddr: SpecialSystem.NetworkAddress,
    channelState: Socket.State,
    waitTime: Socket.WaitTime,
    completedUserGetQueue: BufferDefs.QueueObject,
    newUserInput: CONDITION];

  -- interface

  -- exported by SocketImpl.
  -- procedures
  SocketHandleToChannelHandle: PROCEDURE [sH: SocketHandle]
    RETURNS [ChannelHandle] = INLINE
    BEGIN RETURN[LOOPHOLE[sH, ChannelHandle]]; END;

  ChannelHandleToSocketHandle: PROCEDURE [cH: ChannelHandle]
    RETURNS [SocketHandle] = INLINE BEGIN RETURN[LOOPHOLE[cH, SocketHandle]]; END;

  GetBufferPool: PROCEDURE [cH: SocketHandle]
    RETURNS [BufferDefs.BufferAccessHandle];
  SocketOn: PROCEDURE;

  END.

LOG

Time: January 3, 1980  5:58 PM  By: Dalal  Action: modified interface completely.
Time: March 11, 1980  3:04 PM  By: BLyon  Action: pendingGetQueue modified to completedUserGetQueue.  send, receive (buffer counts) added to create internal. Added GetPacket and PutPacket. 
Time: March 18, 1980  1:56 PM  By: BLyon  Action: Added to/ deleted from socket object.
Time: January 6, 1981  2:21 PM  By: BLyon  Action: Post Mokelumne rework.