Re: [OpenSIPStack] Problem with PIPSocket::Address
Brought to you by:
joegenbaclor
From: <jo...@op...> - 2008-01-15 14:51:18
|
Second BYTE is 0 and will be interpreted by PTRACE as null character. Try this PTRACE(1,"Byte2 " << PString( endereco_local.Byte2() )); or simply cast the byte to int PTRACE(1,"Byte2 " << (int)( endereco_local.Byte2() )); Claudio Miceli wrote: > Hi, > > I have a problem using some objects from pwlib. > > In the following example, when I use the method Byte2 in the > PIPSocket::Address endereco_local, I do not receive a result (empty space). > > I think I am creating the object incorrectly. > > > #define PTRACING 1 > > #include <ptlib.h> > > #include <rtp/rtp.h> > > #include <iostream> > > > > using namespace std; > > class Oi: public PProcess{ > > PCLASSINFO(Oi, PProcess) > > public: > > void Main(); > > }; > > > > PCREATE_PROCESS(Oi) > > void Oi::Main() > > { > > char * filename = "C:\\Documents and > Settings\\claudio\\Desktop\\ttt\\src\\krishna.txt" ; > > cout << "My test"; > > PTrace::Initialise(32, filename, PTrace::Blocks | PTrace::Timestamp | > PTrace::Thread |PTrace::FileAndLine); > > PTRACE(1,"Inside test. Buda helps me \n"); > > PString not_buda = PString("127.0.0.1"); > > PIPSocket::Address endereco_local = PIPSocket::Address(not_buda); > > //endereco_local > > PTRACE(1,"endereco_local " << endereco_local << "\n"); > > PTRACE(1,"not_buda " << not_buda); > > PTRACE(1,"Byte2 " << endereco_local.Byte2()); > > } > > > > Thanks in advance > > > > Claudio Miceli de Farias > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > > |