Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#689 closed defect (duplicate)

send-to udp socket does not work

Reported by: pelsea Owned by:
Priority: major Milestone: Clozure CL 1.5
Component: ANSI CL Compliance Version: trunk
Keywords: udp, sockets Cc:


calls to send-to and receive-from :datagram type sockets fail with response: Error: value #<SIMPLE-VECTOR 15> is not of the expected type (OR (ARRAY CHARACTER) (ARRAY (UNSIGNED-BYTE 8)) (ARRAY (SIGNED-BYTE 8))).

While executing: CCL::VERIFY-SOCKET-BUFFER, in process Listener(6).

I cannot construct any type of array that satisfies VERIFY-SOCKET-BUFFER. All simple arrays return a typecode of 182 but V-S-B wants a range of 215 to 231

Change History (2)

comment:1 Changed 11 years ago by rme

  • Resolution set to duplicate
  • Status changed from new to closed

Those functions work with vectors of 8 bit elements. In the pre-unicode days, characters were 8 bit elements, but now they're not.

I'm going to mark this as a duplicate of #680.

If this is incorrect and you're actually reporting a different problem, please re-open this ticket and, if possible, include some code that shows the problem.

comment:2 Changed 11 years ago by rme

It would probably have been helpful if I had given working example earlier.

In one lisp:

(defparameter *udp-listener* (make-socket :type :datagram :local-port 44444 :format :binary))
(receive-from *udp-listener* 3)  ;blocks

In a separate lisp:

(defparameter *udp-socket* (make-socket :type :datagram))
(defparameter *octets* (make-array 3 :element-type '(unsigned-byte 8)
				  :initial-element (char-code #\x)))
(send-to *udp-socket* *octets* 3 :remote-host ""
	      :remote-port 44444)
Note: See TracTickets for help on using tickets.