Re: udp.scm on cygwin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: udp.scm on cygwin

Daishi Kato
Hi,

I found a relevant entry at;
http://www.cygwin.com/ml/cygwin/2002-11/msg00732.html
and it is actually noted in recvfrom(2).

I did make a patch which works fine for me,
but let me know if there is a better way of fixing,
like using foreign-something.

Next in my wish list for udp.scm is
the support of native-windows.
I will try to setup an environment, but it seems there are several methods:
vcbuild.bat, makefile.vc, cmake, and maybe cygwin+mingw.
For now, which is the best to go?

Attatched is the patch.
Daishi

At Sat, 06 Aug 2005 09:47:58 +0900,
Daishi Kato wrote:

>
> At Fri, 5 Aug 2005 22:53:05 +0200,
> felix winkelmann wrote:
> >
> > On 7/29/05, Daishi Kato <[hidden email]> wrote:
> > > Hi,
> > >
> > > Trying to use udp.scm raises me an error.
> > > It is because of the lack of the INET_ADDRSTRLEN definition.
> > > The workaround so far is to define it in udp.scm.
> >
> > I have applied your patch and uploaded a new version.
> > (Sorry, this is pretty late)
>
> Thanks, felix.  This is just a workaround.
> I don't know what's wrong at the root.
>
> Unfortunately, although this workaround let me
> compile the udp.scm, I was still not able to
> run it. It gives me an exception with (udp-recvfrom),
> something like "bad address".
>
> I will take a more look into it, but
> it may take time due to my lack of experience with cygwin.
> Anybody familiar with cygwin?
>
> Daishi

_______________________________________________
Chicken-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/chicken-users

udp.scm.patch (976 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: udp.scm on cygwin

felix winkelmann
On 10/23/05, Daishi Kato <[hidden email]> wrote:

> Hi,
>
> I found a relevant entry at;
> http://www.cygwin.com/ml/cygwin/2002-11/msg00732.html
> and it is actually noted in recvfrom(2).
>
> I did make a patch which works fine for me,
> but let me know if there is a better way of fixing,
> like using foreign-something.
>

Your patch is word-size and endian-specific, I suggest something like this:

(define udp-recvfrom
  (lambda (sock len)
    (let ((fd (io:descriptor sock))
          (buf (make-string len))
          (from (make-string _sockaddr_in_size)))
      (let-location ((fromlen int _sockaddr_in_size))
        (let ((result
               (restart-nonblocking "recvfrom" fd #t
                                    (lambda () (##net#recvfrom fd buf len
                                                               0 from #$fromlen)))))
          (values result (substring buf 0 result)
                  (##net#inaddr->string from) (##net#inaddr-port from)))))) )

> Next in my wish list for udp.scm is
> the support of native-windows.
> I will try to setup an environment, but it seems there are several methods:
> vcbuild.bat, makefile.vc, cmake, and maybe cygwin+mingw.
> For now, which is the best to go?
>

It depends on your available tools. I recommend the native toolset.
Depending on whether you have the commercial version or not,
you should use either makefile.vc or vcbuilt.bat/vctk-install.txt.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: udp.scm on cygwin

Daishi Kato
Hi felix,

Wow, how nice the locations are.
I'd appreciate if you apply your patch.

I'm not sure if I follow the recent thread;
is tcp.scm supported on native-windows?
I guess udp.scm is easily supported if
tcp.scm is done.

Daishi

At Tue, 25 Oct 2005 07:22:49 +0200,
felix winkelmann wrote:

>
> On 10/23/05, Daishi Kato <[hidden email]> wrote:
> > Hi,
> >
> > I found a relevant entry at;
> > http://www.cygwin.com/ml/cygwin/2002-11/msg00732.html
> > and it is actually noted in recvfrom(2).
> >
> > I did make a patch which works fine for me,
> > but let me know if there is a better way of fixing,
> > like using foreign-something.
> >
>
> Your patch is word-size and endian-specific, I suggest something like this:
>
> (define udp-recvfrom
>   (lambda (sock len)
>     (let ((fd (io:descriptor sock))
>           (buf (make-string len))
>           (from (make-string _sockaddr_in_size)))
>       (let-location ((fromlen int _sockaddr_in_size))
> (let ((result
>       (restart-nonblocking "recvfrom" fd #t
>    (lambda () (##net#recvfrom fd buf len
>       0 from #$fromlen)))))
>  (values result (substring buf 0 result)
>  (##net#inaddr->string from) (##net#inaddr-port from)))))) )
>
> > Next in my wish list for udp.scm is
> > the support of native-windows.
> > I will try to setup an environment, but it seems there are several methods:
> > vcbuild.bat, makefile.vc, cmake, and maybe cygwin+mingw.
> > For now, which is the best to go?
> >
>
> It depends on your available tools. I recommend the native toolset.
> Depending on whether you have the commercial version or not,
> you should use either makefile.vc or vcbuilt.bat/vctk-install.txt.
>
>
> cheers,
> felix


_______________________________________________
Chicken-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: udp.scm on cygwin

felix winkelmann
Yes, tcp.scm is spported there. It's a win32 header-file
(winsock2.h), which changed name in newer VC++ releases,
IIRC.


cheers,
felix

On 10/26/05, Daishi Kato <[hidden email]> wrote:

> Hi felix,
>
> Wow, how nice the locations are.
> I'd appreciate if you apply your patch.
>
> I'm not sure if I follow the recent thread;
> is tcp.scm supported on native-windows?
> I guess udp.scm is easily supported if
> tcp.scm is done.
>
> Daishi
>
> At Tue, 25 Oct 2005 07:22:49 +0200,
> felix winkelmann wrote:
> >
> > On 10/23/05, Daishi Kato <[hidden email]> wrote:
> > > Hi,
> > >
> > > I found a relevant entry at;
> > > http://www.cygwin.com/ml/cygwin/2002-11/msg00732.html
> > > and it is actually noted in recvfrom(2).
> > >
> > > I did make a patch which works fine for me,
> > > but let me know if there is a better way of fixing,
> > > like using foreign-something.
> > >
> >
> > Your patch is word-size and endian-specific, I suggest something like this:
> >
> > (define udp-recvfrom
> >   (lambda (sock len)
> >     (let ((fd (io:descriptor sock))
> >           (buf (make-string len))
> >           (from (make-string _sockaddr_in_size)))
> >       (let-location ((fromlen int _sockaddr_in_size))
> >       (let ((result
> >              (restart-nonblocking "recvfrom" fd #t
> >                                   (lambda () (##net#recvfrom fd buf len
> >                                                              0 from #$fromlen)))))
> >         (values result (substring buf 0 result)
> >                 (##net#inaddr->string from) (##net#inaddr-port from)))))) )
> >
> > > Next in my wish list for udp.scm is
> > > the support of native-windows.
> > > I will try to setup an environment, but it seems there are several methods:
> > > vcbuild.bat, makefile.vc, cmake, and maybe cygwin+mingw.
> > > For now, which is the best to go?
> > >
> >
> > It depends on your available tools. I recommend the native toolset.
> > Depending on whether you have the commercial version or not,
> > you should use either makefile.vc or vcbuilt.bat/vctk-install.txt.
> >
> >
> > cheers,
> > felix
>


_______________________________________________
Chicken-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/chicken-users