-
Notifications
You must be signed in to change notification settings - Fork 77
Refusing connection #14
Comments
If add a return error on OnConnectHandler api?? if return error, indicate refuse the connection from server?? It seem like a idea. |
OnConnectionHandler does not implement a return error statement. Do you mean should I implement the return error statement to the source code ? // SetOnConnectionHandler set on connect handler
func (sf *Server) SetOnConnectionHandler(f func(asdu.Connect)) {
sf.onConnection = f
} if I refuse connections by closing them client is attempting in a infinite loop. mainServer = cs104.NewServer(&myServer{})
mainServer.SetOnConnectionHandler(func(asd asdu.Connect){
asd.UnderlyingConn().Close()
}) |
@ecoshub YES,OnConnectionHandler should implement a return error statement to the source code.
in the file
we can not forbid the client attempting in a infinite loop. only we can do, just refuse it. what about this idea? |
Yes I am currently doing that without implementing any other code to the source code. I am just closing the connection with Let me rephrase the question. Does iec 60870-5 104 protocol has any ASDU command for closing the connection from server like client do with StopDT and does this package has any thing like that? |
sorry ,I can not find. you can refer to lib60870 c library lib60870 doc, maybe you can get an idea. |
Thank you so much for your help I will read doc again for an answer. If there is no answer for my question in the doc I will try to find out a solution and post it from here. |
Hi @thinkgos Thank you for this project it is working great so far.
I am wondering if there is a way to refuse a connection from server.
I have a server and multiple clients, can I limit the connect to server?.
I have try to close "UnderlyingConn()" but clients keep trying connect with attempt.
Do you have any other idea, maybe sending an ASDU like StopDT from server?
The text was updated successfully, but these errors were encountered: