Module: sockets-internals Author: Jason Trenouth Synopsis: UDP sockets Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// EXTERNALS define abstract class () end class; define class (, , ) end class; define class (, , ) end class; define class (, , ) end class; define primary class () end class; define method server-class-for-protocol (protocol == #"UDP") => (class == ) end method; define method client-class-for-protocol (protocol == #"UDP") => (class == ) end method; define method client-class-for-server (server-socket :: ) => (class == ) end method; define method client-class-for-element-type (class == , element-type :: ) => (class == ) end method; define method client-class-for-element-type (class == , element-type == ) => (class == ) end method; define method client-class-for-element-type (class == , element-type == ) => (class == ) end method; define method make (class == , #rest initargs, #key element-type = , direction: requested-direction = #"input-output") => (stream :: ) apply(make, client-class-for-element-type(class, element-type), direction: requested-direction, initargs) end method make; /// Setup serverside reply socket as wrapper around server socket descriptor define method accept (server-socket :: , #rest args, #key element-type = #f, #all-keys) => (connected-socket :: ); let socket = next-method(); let accessor = socket.accessor; accessor.local-host := server-socket.local-host; accessor.local-port := server-socket.local-port; accessor.reply-socket? := #t; socket end method; define method type-for-socket (socket :: ) => (type == #"UDP") #"UDP" end method;