Meteor and socket io - meteor

I am a bit confused about how to use socket.io with Meteor. There is a package called socket-io-client. Is that the only package that I should use or socket-io is required for the client side?
Have anyone implemented a connection? I have managed to print out on the terminal a message that indicates that there is a connection on the server but I cannot print any output on the browser console. Instead I get a message about encoding Uncaught TypeError: response.setEncoding is not a function.
Does the connection is on the same port as my meteor server or must be running on different port?
Thanks very much.

Related

gRPC client can't connect to server Failed parsing HTTP/2, only on my computer

I'm trying to connect to a server from my client using gRPC, but connection always fails only on my pc(macbook pro). My teammate tried with the exact same code, and it works perfectly fine. The following is the error messages from each client and server. We are using protobuf 3, python 3.9. Can anyone give me some hint? Thank You.
Client Error Message
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Failed parsing HTTP/2"
debug_error_string = "{"created":"#1626678822.089372000","description":"Error received from peer ipv4:10.113.66.145:9390", "file":"src/core/lib/surface/call.cc", "file_line":1067,"grpc_message":"Failed parsing HTTP/2","grpc_status":14}"
Server Error Message
[07/19 01:29:32 cctv_service]: Session Connected
E0719 01:29:32.744434791 14615 parsing.cc:302] Unknown frame type 71
I0719 01:29:32.744519637 14615 chttp2_transport.cc:812] W:0x7f3364002ae0 SERVER [ipv4:10.25.211.173:50662] state IDLE -> WRITING [CLOSE_FROM_API]
I0719 01:29:32.744554230 14615 chttp2_transport.cc:812] W:0x7f3364002ae0 SERVER [ipv4:10.25.211.173:50662] state WRITING -> WRITING [begin write in current thread]
Updated MacOS 11.4 to 11.5, problem never appeared again.

What are the causes for os_error: message too long

We have a client and server communicating each other with grpc. Previously the server was running on Windows Server, and the client running on Linux or MacOS. Everything works perfectly until we migrate the server from Windows Server to a docker container.
Then we observed some weird tcp broken when we send a large amount of request from client to server.
Then we dig into the grpc arena and run our client and server with GRPC_VERBOSITY=info and GRPC_TRACE=tcp. Then we found that the disconnection was caused from the server side, with error message below:
tcp_custom.cc:218] write complete on 029FCC20: error={"created":"#1594210168.896000000","description":"TCP Write failed","file":"d:\a\grpc-node\grpc-node\packages\grpc-native-core\deps\grpc\src\core\lib\iomgr\tcp_uv.cc","file_line":72,"grpc_status":14,"os_error":"message too long"}
So my question is what does the os_error: message too long really means? What is the next step for me to investigate?
Linked issue
The string "message too long" is the error message for the error code UV_EMSGSIZE, which corresponds to the Linux error code EMSGSIZE. That appears to generally mean that gRPC is trying to write a buffer that is too large to the socket, but I'm not sure what exactly could trigger that.

Unable to execute RSeval() in remotely connected client in R

I was executing RSeval(c,"4+5"); and encountered :
Error in RSeval(c,"4+5") : remote evaluation failed
in a remote machine connected to a linux server which is running daemon Rserve, where c is connection object. The connection was successful though.
Please share your insights.Thanks in advance
That could be many things, e.g. if Rserve requires authentication. If that's the case, you can use RS.connect and RS.login from the more modern implementation of RSclient (see http://cran.r-project.org/web/packages/RSclient/RSclient.pdf).

SSL. no OPENSSL_Applink

There are openssl server and Qt client using QSslSocket.
When client connected to server server shows no OPENSSL_Applink and shuts down. But with OpenSSL client server works correct. What can be a reason?
#include <openssl/applink.c>
Including applink.c will solve the problem. Please check OpenSSL FAQ
Basically we get this error only if we use any file handling APIs like d2i_X509. I was getting assert failure in applink.c while using this API in windows VC8.0. Later I have done fopen separately and called d2i_X509_fp API.

How to check socket server is open?

I start a socket server and a connection to that server using the following R code:
library(svSocket)
R server: socket <- startSocketServer(port=8888)
R client: socketcon <- socketConnection(port=8888)
I run a while(TRUE) loop in R client and would like to stop it if the socket in R server is closed by stopSocketServer(port = 8888)
Have tried with isOpen but have no luck since it returns TRUE even when i stop R server.
I have a similar problem sometimes when doing parallel work using snow and connections are not closed properly.
when you get error message about:
summary.connections(connection) : Invalid connection
I use:
closeAllConnections()
to shut all the connections that are left open.
There should be no need for you to close the socket client manually. The svSocket package has a closeSocketClients command, which is called by stopSocketServer. Strangely, socketConnection is mentioned and linked to in the documention on CRAN, but there is no manual entry. There is, however, a function called socketClientConnection, which might be the function you are looking for. It might be that the package has seen some changes, which are not properly described in the documentation. You might want to send an e-mail to the package maintainer about this.

Resources