Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Use telnet connect server, assert error message while quiting telnet. #1730

Closed
leonlyd opened this issue Apr 1, 2023 · 1 comment
Closed

Comments

@leonlyd
Copy link

leonlyd commented Apr 1, 2023

I'm a new skynet learner. When I use telnet connect my skynet server.
I type CTRL+] and type "quit" in telnet terminal to quit. It will lead a assert error message in server terminal.

Here's my key server code.

while true do
local readdata = socket.read(fd)
if readdata ~= false then
print(fd .. " recv" .. readdata)
for k,v in pairs(clients) do
socket.write(k , readdata)
end
else
clients[fd] = nil
for k,v in pairs(clients) do
socket.write(k , "Someone exit")
end
socket.close(fd)
end
end

Here's the skyner server terminal error message.

[:00000009] lua call [0 to :9 : 0 msgsz = 24] error : ./skynet/lualib/skynet.lua:860: ./skynet/lualib/skynet.lua:331: ./skynet/lualib/skynet/socket.lua:307: assertion failed!
stack traceback:
[C]: in function 'assert'
./skynet/lualib/skynet/socket.lua:307: in function 'skynet.socket.read'
./service/gateway/init.lua:12: in field 'callback'
./skynet/lualib/skynet/socket.lua:145: in field '?'
./skynet/lualib/skynet/socket.lua:206: in upvalue 'f'
./skynet/lualib/skynet.lua:281: in function <./skynet/lualib/skynet.lua:253>
stack traceback:
[C]: in function 'assert'
./skynet/lualib/skynet.lua:860: in function 'skynet.dispatch_message'

Should I ignore this message or use other way to deal will disconnected.

@leonlyd leonlyd closed this as completed Apr 1, 2023
@leonlyd
Copy link
Author

leonlyd commented Apr 1, 2023

Sorry I make a mistake . I add return line when I got false by socket.send. It won't generate make the assert error.

Repository owner locked and limited conversation to collaborators Apr 1, 2023
@cloudwu cloudwu converted this issue into discussion #1731 Apr 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant