Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

勘误5.4.5排版问题 - 运行日志 #5

Open
bsspirit opened this issue Mar 19, 2015 · 0 comments
Open

勘误5.4.5排版问题 - 运行日志 #5

bsspirit opened this issue Mar 19, 2015 · 0 comments

Comments

@bsspirit
Copy link
Owner

运行客户端程序

> library(websockets)
> client = websocket("ws://192.168.1.201",port=7681)
> rece<-function(DATA, WS, HEADER) { +   D='' +   if(is.raw(DATA)){ +     cat("raw data") +     D = rawToChar(DATA) +   } +   cat("==>",D,"\n")}
> set_callback("receive",rece, client)
> websocket_write("2222", client)
[1] 1

> service(client)
raw data==> You sent 2222

> websocket_close(client)
Client socket 3  was closed.

转行问题, 改为

> library(websockets)
> client = websocket("ws://192.168.1.201",port=7681)
> rece<-function(DATA, WS, HEADER) { 
+   D='' 
+   if(is.raw(DATA)){ 
+     cat("raw data") 
+     D = rawToChar(DATA) 
+   } 
+   cat("==>",D,"\n")
+}
> set_callback("receive",rece, client)
> websocket_write("2222", client)
[1] 1

> service(client)
raw data==> You sent 2222

> websocket_close(client)
Client socket 3  was closed.
@bsspirit bsspirit changed the title 勘误5.4.5排版问题 勘误5.4.5排版问题 - 运行日志 Mar 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant