port and address are local to the D() function. The values that they contain just happen to be addresses. Changing their value (as in the address value contained within the local variable) isn't going to extend beyond the function as you've seen. If you want to change the address of port, you need to pass a reference to it. This is isn't any different than passing any other numeric variable's value and expecting a change to the numeric value outside of the function(), you're just dealing with a char pointer data type.
is also a deference, so that gives you 3 differences. What does your declaration of A look like now? Better yet, what does your updated code look like?
Seems strtok() would be more appropriate here. First call gives you "CHANNEL" second gives you the IP and the third gives you the port.
If you don't want to destroy your original string, then you can make a copy, and pass a reference for the port and the address and assign your result to the results of strtok() to them. Just off the top of my head.