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

could not find method :* for nil, or :r* for 256 #62

Closed
eko234 opened this issue Mar 11, 2022 · 2 comments
Closed

could not find method :* for nil, or :r* for 256 #62

eko234 opened this issue Mar 11, 2022 · 2 comments

Comments

@eko234
Copy link

eko234 commented Mar 11, 2022

Hi, I'm trying to implement a terminal multiplayer game with the rpc module but
I'm having trouble with it, I have a server and N clients, when a client connects to a
server it sends the server his host and port so the server also establishes a connection
with each client, so each client is connected to the server and the server is connected to each client,
I keep the connections in a table.

What I want to do is to lets say, send a message to every client from the server, but when I do so
the server and the first client it tries to communicate with hangs, and sometimes I get this error:

error: could not find method :* for nil, or :r* for 256
in rpc-function [/usr/local/lib/janet/spork/rpc.janet] on line 83, column 23
in game-repl [main.janet] (tailcall) on line 45, column 30
in _thunk [main.janet] (tailcall) on line -1, column -1
in cli-main [boot.janet] on line 3677, column 17

I'm at a loss trying to understand or debug this, hope you can help me out.

@eko234
Copy link
Author

eko234 commented Mar 11, 2022

btw, when there is only a connection between the server and one client, things work well...

@bakpakin
Copy link
Member

bakpakin commented Jul 2, 2022

Sorry, long time sitting here, I should have responded earlier. However, I will answer for the next person to come along.

The RPC module has a limitation about many concurrent messages, quoted from the source:

### Limitations:
###
### Currently calls are resolved in the order that they are sent
### on the connection - in other words, a single RPC server must resolve
### remote calls sequentially. This means it is recommended to make multiple
### connections for separate transactions.

I think this may apply to you, although I can't say for certain without source code.

@bakpakin bakpakin closed this as completed Jul 2, 2022
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

2 participants