[MLton-user] Problem with Socket.ioDesc in version 20030711 (Bug?)

joaoraf@solar.com.br joaoraf@solar.com.br
Mon, 14 Jul 2003 13:05:03 -0300


Hi,
	While developing a server application, I ran into a strange problem with the latest (20030711) mlton compiler while
	compiling the following program:

---

fun test() = let 
  val listen_socket : Socket.passive INetSock.stream_sock = INetSock.TCP.socket ()
  val addr = INetSock.any 8000 
  val _ = Socket.bind (listen_socket,addr)
  val _ = Socket.listen (listen_socket,10)
  val iodesc = Socket.ioDesc listen_socket (* this is the bug line *)
  fun accept () = 
    Socket.accept listen_socket 
  fun accept_loop() = let
     val (sock,rem_addr) = accept()
     val (in_addr,port) = INetSock.fromAddr rem_addr  
  in 
    ( 
     print ("Connection accepted from " ^ ( NetHostDB.toString in_addr) ^ ":" ^ 
       (Int.toString port) ^ "\n" ) ;
     accept_loop() ) 
  end
in
  accept_loop()
end

val _ = test()

---	
	
	When I try to compile the program using "mlton -output test test.sml" the compiler outputs thousands of lines of what seems to be the whole program (including basis library) defunctorized and complains about "empty tyvars in PolyVal dec".  If I remove the line with the call to Socket.ioDesc, the program compiles correctly, but unfortunately I need to get the iodesc of the socket for polling. Would you have any clue about how to solve this? (Note: the program compiles correctly using 200303 version).

	Thanks,
		Joao Rafael Moraes Nicola
		joaoraf@solar.com.br

P.S.: I have attached two files: "output1.txt.gz" and "output2.txt.gz" with the outputs (stdin and stderr) of "mlton -output test1 test.sml &> output1.txt" and "mlton -verbose 3 -output test1 test.sml &> output2.txt"

-- 


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
MLton-user mailing list
MLton-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-user