mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
When you create an ipv6 listening socket in mIRC, TCP or UDP, at the lower level in winsock, there is a member in a structure that's always on by default on Windows: IPV6_V6ONLY
This parameter means that for an ipv6 socket, by default, it will only accept/connect to ipv6 connections/server, this is not great in many cases (that parameter can be found off by default on different OS).
For example, creating a game server which has to accept anyone, so any version of ip.
If this option is turned off, ipv4 connection should be able to connect to ipv6 server, the ipv4 will be mapped to some ipv6 addresses.
In fact it looks like this also works for ipv6 client to ipv4 server.
I would like to get support for this via some switch in /socklisten, /sockudp -k and eventually /sockopen but i'm really looking for the server side of it

https://docs.microsoft.com/en-us/windows/win32/winsock/dual-stack-sockets


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
I looked into this long ago when I first added IPv6 support. At the time, I decided not to add support for it since dual stack was not supported by XP, which was still widely used. I'll add this to my to-do list. However, since mIRC is still technically supporting XP, be aware that this option will not work on XP.

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Thanks for adding this in the new beta, I did not expect it to be added at all after your reply, I'll try to beta test it as soon as i can.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I was on vacations for a while, I just tested it locally, both tcp and udp, ipv6 server and connecting to 127.0.0.1 resulted in $sock(name).ip being ::ffff:127.0.0.1 from the server's point of view.
For tcp, I'm not the one actually using the value since it's abstracted but it worked perfectly, I'm in charge of using the value for udp and it also worked perfectly without any modification.

Note that one absolutely needs a bind to an ipv6 address for dual socket to work.
If you do not use the -d switch to control the bind yourself on /socklisten and /sockudp, and depending on the mIRC options for binding at alt o > connect > options > port, the bind may not be ipv6 and a simple "/socklisten -u name port" would then not bind to an ipv6 address. This is important and it would be great if it were explained in the help file.

One should always control the bind with the -d switch because iirc, in some situations, the default bind for a socklisten is not according to the binding option. I need to check this more.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard