[Ovirt-devel] Re: [PATCH viewer] connect to the ovirt-vnc-proxy server to access a vm's vnc

Alan Pevec apevec at gmail.com
Thu May 21 10:46:03 UTC 2009


>
> >> +// port to try to listen on, if we can't, increment until we find one
> we can
> >> +const int PORT_RANGE_START = 5600;
> >>
> > Since server default is 5900, does this mean we always increment though
> > 400 ports?
> No, this is the start of the range for the tunnel port which the viewer
> opens on your local machine. When the user clicks a vm name,
> ovirt-viewer connects to this local port, which accepts vnc data,
> prepending the target vm name, and sends it onto port 5900 on the
> server. Since this port is going to be opened on the client's machine,
> we don't know which ports are available ahead of time, so I start trying
> to open ports at 5600 and increment until we found one that's available.
>

Why not just use random port by setting sin_port=0 ?
Patch attached, untested.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090521/70c77d5a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: random-port.patch
Type: text/x-diff
Size: 1262 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090521/70c77d5a/attachment.bin>


More information about the ovirt-devel mailing list