Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
nightsta69

closing network connection

Question

so i started working with the network disk that comes as dungeon loot for OC and i think i've run into something. i can set IP's for my server, listen on ports, open connections between computers and send messages, but when i try to close the connection, it doesn't fire an event to close the connection.

 

server A

network.ip.bind("192.168.1.1")
network.tcp.listen(1024)

while true do local _, event, ch, data, remoteaddr, port = event.pull("tcp") print(event, ch, data, remoteaddr, port) end

server B

network.ip.bind("192.168.1.10")
network.tcp.open("192.168.1.1", 1024) -- Server A response with a connection event when this is sent

network.tcp.send(1, "test") -- Server A responds with message event

network.tcp.close(1) -- errors with address must be a string!!

network.tcp.close("192.168.1.1") -- does nothing that i can see, and doesn't fire event on server A but doesn't error out either.

network.tcp.close("192.168.1.1", 1) -- does nothing as well

also as well i seem to not understand the principle behind the channels. if some sort of brief explaination of the channels could be given, that would be great. and maybe some help on why i can't close connections.  any help we be greatly appreciated. thanks!

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.