[
https://issues.apache.org/jira/browse/CLOUDSTACK-9689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15895032#comment-15895032
]
ASF GitHub Bot commented on CLOUDSTACK-9689:
--------------------------------------------
Github user ramkatru commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1845#discussion_r104242930
--- Diff:
services/console-proxy-rdp/rdpconsole/src/main/java/streamer/apr/AprSocketSource.java
---
@@ -103,44 +103,46 @@ public void poll(boolean block) {
if (verbose)
System.out.println("[" + this + "] INFO: Reading data from
stream.");
- // to unblock during reboot
- long startTime = System.currentTimeMillis();
// FIXME: If pull is destroyed or socket is closed, segfault
will happen here
- int actualLength = (block) ? // Blocking read
- Socket.recv(socket, buf.data, buf.offset,
buf.data.length - buf.offset)
- : // Non-blocking read
- Socket.recvt(socket, buf.data, buf.offset,
buf.data.length - buf.offset, 5000000);
+ int actualLength;
+ if(block) {
+ // Blocking read
+ actualLength = Socket.recv(socket, buf.data, buf.offset,
buf.data.length - buf.offset);
+ } else {
+ // non blocking read with 5 seconds timeout
+ Socket.timeoutSet(socket, 5000000);
+ actualLength = Socket.recv(socket, buf.data, buf.offset,
buf.data.length - buf.offset);
--- End diff --
@anshul1886 can you please verify if timeout can be set on a socket that is
not opened with APR_SO_NONBLOCK flag?
> [Hyper-V] VM console is freezing sometimes
> ------------------------------------------
>
> Key: CLOUDSTACK-9689
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9689
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: Anshul Gangwar
> Assignee: Anshul Gangwar
>
> With some VMs console is freezing very frequently and becomes unresponsive
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)