-
Notifications
You must be signed in to change notification settings - Fork 174
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
The server handler should only be able to craft a response packet and should not receive a net.PacketConn #190
Comments
Hi @begetan,
Have a look at |
Basically what @pmazzini said. I will write examples soon (days hopefully). |
Because of the above, @begetan could you please rename this issue to reflect what has to be done, or close this and reopen a new one? Thanks! |
@pmazzini In my point of view there are some quite reasonable abstraction levels for public API:
There is one already open discussion about implementation of 1 and 2 level in library: #186 But here I would like to open another discussion about implimentation of layers 3 and 4. I just showed an example of separation logic between layer 3 and 4 including Interface method to handle server level configuration. But let's focus on architecture first because it's most important for quite new library. I believe your code implementation is much more professional than other projects and you want to share experience for wide range of programmers. So it should be structured well. |
@begetan Do you mean that the server handler should only be able to craft a response packet and should not receive a Can the issue title be properly updated? |
After better thinking and evaluation of current implementation I see no reason to pass global server parameters to user handler. It depends on concurency model and user architecture. But now I am definitely sure about handling only packet structure, not connections. |
I've wanted to rewrite my example DHCP server with recently added server.go implementation but haven't found no library code for sending packet back to network.
On the example code sending function was provided in user handler code, but actually this function is more complicated and should have a deal with different OSes, socket options and should be outside of user code in library implementation. So proposal is to make handler work only with packet manipulation, not network binding.
Rest part of initial proposal is omitted for now
The text was updated successfully, but these errors were encountered: