The serverPort member is already set in rfbGetClient(), if we
set it again in rfbInitClient(), this breaks playing of vncrec
files (this relies on serverPort set to -1).
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
[jes: adjusted coding style, made sure port is initialized correctly]
Signed-off-by: Vic Lee <llyzs@163.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
To make this work, we also have to initialize sockets
to a default value of -1.
Also close a client listen socket if it's open.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fixes warning about closesocket being implicitly declared.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Forking the whole process from deep within a library call does
not really work at all with apps that use multiple threads, i.e. every
reasonably modern GUI app. So, provide a non-forking listen function so
that the caller can decide if to fork, start a thread, etc.
This implementation adds a timeout parameter to be able to call the
listen function multiple times so that it's possible to do sth. else
in between, e.g. abort listening.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When working on a program which searches the display for some image, one
does not want to search again without getting an FB update. Add a
callback to make this possible.
There was an unnecessary assignment, and an assignment of a string that
was to be free()ed later, so it has to be strdup()ed.
Both issues spotted by Roman Held.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>