[usocket-devel] Fwd: lispworks udp

Chun Tian (binghe) binghe.lisp at gmail.com
Tue Feb 26 19:20:11 UTC 2008


Hi, usocket project

More work on LispWorks UDP support has been done in these days, now I  
have both UDP server and client API, and send/recv message  support.

SVN URL is https://cl-net-snmp.svn.sourceforge.net/svnroot/cl-net-snmp/lispworks-udp

P.S. still waiting for usocket UDP API:)

Chun Tian (binghe)

>>
>>
>
> New message-based API and new test has been submited into SVN head,  
> see this demo:
>
> (defun udp-echo-test-3 (&optional (port 10000) (function #'identity))
>  (comm:with-udp-server (server :function function :service port)
>    ;;; stream test
>    (comm:with-udp-stream (stream "localhost" port :read-timeout 1)
>      (let ((data "Hello, world!"))
>        (format stream "~A" data)
>        (terpri stream) ;; = "~%" or #\Newline
>        (force-output stream)
>        (format t "STREAM: Send message: ~A~%" data)
>        (let ((echo (read-line stream nil nil)))
>          (format t "STREAM: Recv message: ~A~%" echo))))
>    ;; message test
>    (comm:with-udp-socket (socket :read-timeout 1)
>      (let ((data #(1 2 3 4 5 6 7 8 9 10)))
>        (comm:send-message socket "localhost" port data)
>        (format t "SOCKET: Send message: ~A~%" data)
>        (let ((echo (comm:receive-message socket)))
>          (format t "SOCKET: Recv message: ~A~%" echo))))))
>
> CL-USER 101 > (udp-echo-test-3)
> ;; server started
> STREAM: Send message: Hello, world!
> STREAM: Recv message: Hello, world!
> SOCKET: Send message: #(1 2 3 4 5 6 7 8 9 10)
> SOCKET: Recv message: #(1 2 3 4 5 6 7 8 9 10)
> NIL
>
> You can choose either a MESSAGE or STREAM to do a UDP client job. I  
> also improved the UDP server design today with help from my friend -  
> a C-based network programmer, I add a RCVTIMEO into the main loop,  
> and we can always kill the server process successfully now.
>
> I think those API are stable now.
>
>>
>>
>>> I think you must be a LispWorks customer and can test the 5.1.1  
>>> beta program.
>>
>> yes my research center employer bought the LW32 for MAc Os X  
>> licence. We have a Music Composition called OpenMusic that was  
>> written in Digitool MCL, and we have to port it to to LW because  
>> Digitool broke down and never came up with a Mac Intel version.
>> I wrote myself an interactive improvisation system using OpenMusic  
>> which communicates through udp with the Max/MSP real-time  
>> environment :  the port ws stuck since LwUdp was not available, and  
>> I'm not a network programmer as you guessed.
>>
>
> I'm new to OpenMusic, it seems interest. I'll take some spare time  
> to look at it. Hope this porting work can be done successfully:)
>
>>
>> Cheers and thanks again
>>
>> you will of course be credited in the Lispworks version of OMax (http://www.ircam.fr/equipes/repmus/OMax 
>> )
>
> Thanks:)
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/usocket-devel/attachments/20080227/d8d4b58d/attachment.html>


More information about the usocket-devel mailing list