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

UDP Conn implemented #29

Merged
merged 6 commits into from
Jul 20, 2024
Merged

UDP Conn implemented #29

merged 6 commits into from
Jul 20, 2024

Conversation

nickaxgit
Copy link

Hi

Sorry - some of my comments are a bit sharp - I was a bit frustrated at the time - please don't be offended !

I have source for a simple demo (echo client .. ) if that's useful

usage is fundamentally like this:-

` conn.OpenDialUDP(1042, routerMAC, svAddr)

 buff := make([]byte,64)

 for{	
	println("Writing")
 	conn.Write([]byte("hello"))
 	
	time.Sleep(1* time.Second)

	println("reading")
 	n,err  := conn.Read(buff)
 	if err != io.EOF{
 		println("Read:",n, " bytes",string(buff))
		break
 	}
	
 }

 conn.Close()

`

Not absolutely sure what to do with some of the things that don't really apply to UDP - setWriteDeadline, close etc ... but what is there is working well for my purposes - I built a very simple sequenced numbered, retrying "reliable" protocol on top (a watered down TCP) and able to receive snapshots from my remote camera on a cellular connection - it's working great .

Cheers

Nick

@soypat
Copy link
Owner

soypat commented Jul 13, 2024

Thank you a bunch for this work nick! Will try to get around to looking at it this weekend, if not sometime throughout the week. Still settling down after a long week at Gophercon :)

@nickaxgit
Copy link
Author

nickaxgit commented Jul 13, 2024 via email

eth/headers.go Outdated Show resolved Hide resolved
stacks/port_tcp.go Outdated Show resolved Hide resolved
stacks/port_tcp.go Outdated Show resolved Hide resolved
stacks/port_tcp.go Outdated Show resolved Hide resolved
stacks/port_udp.go Show resolved Hide resolved
stacks/udpconn.go Outdated Show resolved Hide resolved
stacks/udpconn.go Outdated Show resolved Hide resolved
stacks/udpconn.go Outdated Show resolved Hide resolved
stacks/udpconn.go Show resolved Hide resolved
stacks/udpconn.go Outdated Show resolved Hide resolved
… function, errUnsupported returns, function comments etc)
@nickaxgit nickaxgit requested a review from soypat July 15, 2024 17:56
stacks/ring.go Outdated Show resolved Hide resolved
stacks/udpconn.go Outdated Show resolved Hide resolved
@soypat soypat changed the base branch from main to dev July 19, 2024 09:09
Copy link
Owner

@soypat soypat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Nick! Some documentation changes are pending. I'd like to do some cleanup and add tests sometime this week before merging to main so I've added a new dev branch and rebased onto it.

stacks/port_tcp.go Outdated Show resolved Hide resolved
stacks/portstack.go Outdated Show resolved Hide resolved
stacks/tcpconn.go Outdated Show resolved Hide resolved
stacks/ring.go Outdated Show resolved Hide resolved
@nickaxgit
Copy link
Author

Morning - My settings file .. I am missing a few of your go config options - should I include them ?

It's interesting my formatOnSave is false - I had been trying to change it through the command palette after a google search but could never get it to stick

{
"[go]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
},
"editor.defaultFormatter": "golang.go"
},
"go.formatTool": "gofmt",
"settingsSync.ignoredExtensions": [],
"notebook.kernelProviderAssociations": [],
"editor.formatOnSave": true,
"terminal.integrated.automationShell.windows": "",
"git.autofetch": true,
"html.autoClosingTags": false,
"git.enableSmartCommit": true,
"diffEditor.ignoreTrimWhitespace": false,
"liveServer.settings.donotShowInfoMsg": true,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.profiles.windows": {
"C:\Windows\System32\cmd.exe (migrated)": {
"path": "C:\Windows\System32\cmd.exe",
"args": [
"-ExecutionPolicy",
"Bypass"
]
}
},
"files.exclude": {
// Hide all .js files when have a .ts file
"/*.js": {
"when": "$(basename).ts"
},
"
/.js.map": true
},
"workbench.editorAssociations": {
"
.ipynb": "jupyter-notebook"
},
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"[python]": {
"editor.formatOnType": true
},
"cmake.configureEnvironment": {
"PICO_SDK": "c:\pico-sdk"
},
"cmake.configureOnOpen": true,
"cmake.configureSettings": {},
"editor.fontSize": 18,
"window.zoomLevel": 1,
"micropico.manualComDevice": "com9:",
"cmake.pinnedCommands": [
"workbench.action.tasks.configureTaskRunner",
"workbench.action.tasks.runTask"
],
"arduino.useArduinoCli": true,
"editor.defaultFormatter": "tinygo.vscode-tinygo"
}

@nickaxgit
Copy link
Author

" so I've added a new dev branch and rebased onto it."

Not sure what the implications are for me.. do I keep committing/pushing to my fork - or do I need to rebase that (or something .. out of my depth here)

@soypat
Copy link
Owner

soypat commented Jul 19, 2024

@nickaxgit No special action needed on your part- just fix the issues and eventually your changes will be in main when I finish writing the tests.

Edit: Maybe add the top level [go] key and values in my JSON to yours?

@soypat soypat merged commit 21dfa86 into soypat:dev Jul 20, 2024
@soypat
Copy link
Owner

soypat commented Jul 20, 2024

Nick! Thank you for your contribution! 😄

Merging into dev, discussion should continue in #31

Repository owner locked as resolved and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants