Network test fixes.

This commit is contained in:
lotodore
2007-10-26 10:51:03 +00:00
parent e0f1193963
commit 9368c5f16e
5 changed files with 32 additions and 15 deletions
+3 -2
View File
@@ -80,6 +80,7 @@
(lambda (sock local-addr local-port)
(let ((af (cdr sock)))
(setsockopt (car sock) SOL_SOCKET SO_REUSEADDR 1)
(setsockopt (car sock) SOL_SOCKET SO_LINGER (cons 1 60))
(bind (car sock) af (inet-pton af local-addr) local-port)
sock)))
@@ -138,8 +139,8 @@
(define sock-recv-sctp!
(lambda (sock buf)
(let ((ret (sctp-recvmsg! (car sock) buf)))
(let ((info (list-ref ret 3))) ; Return number of bytes and PPID
(cons (car ret) (ntohl (list-ref info 2)))))))
(let ((info (list-ref ret 3))) ; Return number of bytes, stream # and PPID
(list (car ret) (ntohs (car info)) (ntohl (list-ref info 2)))))))
#!
(sock-send (car (sock-accept (sock-bind-listen (sock-create-tcp AF_INET) "127.0.0.1" 5555 5))) "Hallo")