- Joined
- Nov 24, 2014
- Messages
- 3,162
- Reaction score
- 3,513
- Trophies
- 2
- Age
- 31
- Location
- Bologna
- Website
- rinnegatamante.it
- XP
- 4,879
- Country



"normal website" as in one I can access with a browser. And port 1 because it's the one assigned to ICMP (ping) ? Was trying port 80 before
Are you using the network descriptor?
Also Socket needs an IP, not an http URL since there is no url resolver atm.
These are all the available functions from standard C for socketing: https://github.com/smealum/ctrulib/blob/master/libctru/include/sys/socket.h

I am using the network descriptor (copied the "networking_features.xml" to the folder with the .3dsx and index.lua), and using an IP and not a url

@Rinnegatamente I modified my code a little, and added a DNS query function, the code is here: http://pastebin.com/fzFtjM06
the values I got by testing on PC were good, but I can't test it on 3ds since the socket connection fails. Can you help me fix that?
(my app is an attempt at recreating installMii in lua, since @simonepsp doesn't seem to update it)

Thanks for the info, didn't know that. I renamed it with the correct name, but I still get a "failed connecting server" on line 29 (the dns connect). do I need to start a server for it to work?
repeat
clientsocket=Socket.connect("192.99.56.120",1121)
repeat --print result and wait for button press
if clientsocket==nil then
Screen.debugPrint(0,0,"nil",Color.new(255,255,255),TOP_SCREEN)
else
Screen.debugPrint(0,0,"not nil",Color.new(255,255,255),TOP_SCREEN)
end
Screen.flip()
Screen.waitVblankStart()
Screen.refresh()
Screen.clear(TOP_SCREEN)
Screen.clear(BOTTOM_SCREEN)
oldpad=pad
pad=Controls.read()
until pad~=0 and oldpad==0
until clientsocket~=nil

I'm trying to connect a client socket to a server, but Socket.connect always returns nil, even though the server detects the connection. I made this loop to get my 3DS to register the connection, but I keep seeing either nil or a "Failed creating socket" error.
Code:repeat clientsocket=Socket.connect("192.99.56.120",1121) repeat --print result and wait for button press if clientsocket==nil then Screen.debugPrint(0,0,"nil",Color.new(255,255,255),TOP_SCREEN) else Screen.debugPrint(0,0,"not nil",Color.new(255,255,255),TOP_SCREEN) end Screen.flip() Screen.waitVblankStart() Screen.refresh() Screen.clear(TOP_SCREEN) Screen.clear(BOTTOM_SCREEN) oldpad=pad pad=Controls.read() until pad~=0 and oldpad==0 until clientsocket~=nil
Uh, we're using a CIA build. It already has the correct permissions, right?Read latest posts...

Uh, we're using a CIA build. It already has the correct permissions, right?
EDIT: I'm the server side programmer by the way.
soc:U is in the workaround, and Socket.init() was just before that code segment.MMhhh CIA version should be fine (at least if you're using default workarounds).
Double check if you have soc:u in ServiceAccessControl section of your workaround.
(I'm assuming the code you posted is just a part of the code since you need to call Socket.init before any socketing func).

soc:U is in the workaround, and Socket.init() was just before that code segment.
We just checked for soc:U, it's there. Also, we have Socket.init() right before that snippet.MMhhh CIA version should be fine (at least if you're using default workarounds).
Double check if you have soc:u in ServiceAccessControl section of your workaround.
(I'm assuming the code you posted is just a part of the code since you need to call Socket.init before any socketing func).
A very recent commit. 7 commits from latest.Are you using official R5 or latest commit from repository?


