- Joined
- Nov 24, 2014
- Messages
- 3,162
- Trophies
- 2
- Age
- 29
- Location
- Bologna
- Website
- rinnegatamante.it
- XP
- 4,857
- Country
I'm trying to use the socket functions, but...
My code is edited from the socket example:
Basically it should just wait for the connection and then close it. Probelm is that the cid is never "nil", meaning that every loop it thinks there is somekind of unknown connection coming.Code:Socket.init() server = Socket.createServerSocket(15505) -- Create a debug console cns = Console.new(TOP_SCREEN) state = 0 while true do -- Clear screen Screen.refresh() Screen.clear(TOP_SCREEN) -- State 0: Looking for connections if state == 0 then -- Writing info on screen Console.append(cns, "Looking for connections..."..math.random(1,2)) Console.append(cns, "\nIP: "..Network.getIPAddress().."\n") -- Searching for clients cid = Socket.accept(server) if cid == nil then Console.append(cns, "noclient") else Console.append(cns," cid: "..cid) --state = 1 Socket.close(cid) end Console.show(cns) Screen.flip() Screen.waitVblankStart() Console.clear(cns) end end
I tried many different ports but it didn't help. I checked the traffic with Wireshark and there shouldn't be any packets going to the 3ds. Any ideas?
It's a common bug solved after r4 release ( https://github.com/Rinnegatamante/lpp-3ds/commit/3db26bcc567691cb55b9eeaa79f74f90b3ea2a38 ).
If you have a working devkitPro installed you can compile on your own latest GitHub version to solve.