Ignore:
Timestamp:
02/14/06 02:30:42 (18 years ago)
Author:
piso
Message:

Socket extensions (Erik Huelsmann).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/socket.lisp

    r7359 r10991  
    11;;; socket.lisp
    22;;;
    3 ;;; Copyright (C) 2004 Peter Graves
    4 ;;; $Id: socket.lisp,v 1.2 2004-08-03 16:47:00 piso Exp $
     3;;; Copyright (C) 2004-2006 Peter Graves
     4;;; $Id: socket.lisp,v 1.3 2006-02-14 02:30:19 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    4545  (%server-socket-close socket))
    4646
     47(declaim (inline %socket-address %socket-port))
     48(defun %socket-address (socket addressName)
     49   (java:jcall "getHostAddress" (java:jcall-raw addressName socket)))
     50
     51(defun %socket-port (socket portName)
     52   (java:jcall portName socket))
     53
     54(defun socket-local-address (socket)
     55   "Returns the local address of the given socket as a dotted quad string."
     56   (%socket-address socket "getLocalAddress"))
     57
     58(defun socket-peer-address (socket)
     59   "Returns the peer address of the given socket as a dotted quad string."
     60   (%socket-address socket "getInetAddress"))
     61
     62(defun socket-local-port (socket)
     63   "Returns the local port number of the given socket."
     64   (%socket-port socket "getLocalPort"))
     65
     66(defun socket-peer-port (socket)
     67   "Returns the peer port number of the given socket."
     68   (%socket-port socket "getPort"))
     69
    4770(provide '#:socket)
Note: See TracChangeset for help on using the changeset viewer.