Changeset 4123
- Timestamp:
- 09/29/03 14:10:15 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Extensions.java
r4043 r4123 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Extensions.java,v 1.1 2 2003-09-24 22:53:30piso Exp $5 * $Id: Extensions.java,v 1.13 2003-09-29 14:10:15 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 85 85 } 86 86 }; 87 88 // ### make-binary-socket 89 // make-binary-socket host port => stream 90 private static final Primitive2 MAKE_BINARY_SOCKET = 91 new Primitive2("make-binary-socket", PACKAGE_EXT, true) { 92 public LispObject execute(LispObject first, LispObject second) 93 throws ConditionThrowable 94 { 95 String host = LispString.getValue(first); 96 int port = Fixnum.getValue(second); 97 try { 98 Socket socket = new Socket(host, port); 99 BinaryInputStream in = 100 new BinaryInputStream(socket.getInputStream()); 101 BinaryOutputStream out = 102 new BinaryOutputStream(socket.getOutputStream()); 103 return new TwoWayStream(in, out); 104 } 105 catch (Exception e) { 106 throw new ConditionThrowable(new LispError(e.getMessage())); 107 } 108 } 109 }; 87 110 }
Note: See TracChangeset
for help on using the changeset viewer.