Executing an Open() transaction on some WAP gateways results in a ERedirect_ind_s method returning. This is clearly a method of load balancing the requests to the WAP server.
However, what is the format of the data returned? On all WAP gateways I have tried I get 8 bytes which is clearly composed of 2 IP addresses.
However, on one gateway (devgate2.openwave.com) the 2nd IP address is the same as the one redirecting. The 1st IP address is a valid WAP server that responds fine.
On another (the O2 WAP gateway, UK), the 1st IP address doesn't respond to WAP requests but the 2nd does. Both are different from the redirecting WAP server.
What is the protocol? Which address should be used?
I'll answer my own question. The 8 bytes are part of the WAP specification for a redirect response from a WAP gateway. The first 2 bytes contain various flags. The second two contain a UDP port number and the final 4 contain an IP address. The idea is that you open the server at the specified address and port. The flags determine i) if a port is specified, ii) if an IP address is specified and iii) some other stuff that didn't look very interesting. If you fetch wap pages from a carrier's gateway, you will probably be redirected thus.
How to handle RWSPCOConn::ERedirect_ind_s
2004-10-03, 15:23#3