Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Networking Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.3 Printing Socket Addresses

If you construct an address for the Simple Mail Transfer Protocol (SMTP) port on Rogue Wave's mail gateway using this code:

you can print the address using this code:

The output is:

You can also use the function RWSocket::id() to get an ASCII representation of the socket address. You can print the address using this code:

The id() function enables you to tailor the amount of output by supplying an optional argument. The argument is an integer between 0 and 9, and (in general) controls the amount of output -- the higher the argument, the more descriptive the output.

For example, addr.id(9) returns the string:

Table 1 shows sample output from id() for each value of its parameter for an Internet stream address. Other address types will have different output.

Table 1: Behavior of id and sample output for an Internet stream address 

Parameter provided to id() May access network Always includes family field Sample output for id(parameter) given RWInetAddr( "198.68.9.6:mail" )

0(default)

   

198.68.9.6:mail

1

   

198.68.9.6:mail

2

   

inet:stream:198.68.9.6:mail

3

X

 

roguewave.com:25

4

X

 

roguewave.com(198.68.9.6):25(smtp)

5

X

 

roguewave.com(198.68.9.6):25(smtp)

6

X

X

inet:stream:roguewave.com:25

7

X

X

inet:stream:roguewave.com(198.68.9.6):25(smtp)

8

X

X

inet:stream:roguewave.com(198.68.9.6):25(smtp)

9

X

X

inet:stream:roguewave.com(198.68.9.6):25(smtp,mail)



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.