Bug#532228: TCPStream: Does only send one packet, if read from the stream
Tobias Frost
tobi at coldtobi.de
Sun Jun 7 16:35:46 UTC 2009
Package: libcommoncpp2-dev
Version: 1.7.3-1
Severity: normal
DESCRIPTION
I just disovered, that the class TCPStream does not work as expected.
When you do a "send -- receive -- send" , only one package is sent. The second send is not performed.
When you do a "send -- send" , two packages are sent, as expected.
TESTCASE
Attached are two testcases: test.cpp and test_noreceive.cpp
Compile it with e.g g++ test_noreceive.cpp `ccgnu2-config --flags --libs --includes`
The first does the send -- receive -- send, the second just has commented out the receive line.
To test it, use netcat -l -p 12345
SAMPLE OUTPUT
tobi at mordor:~/workspace/test$ g++ test.cpp `ccgnu2-config --flags --libs --includes --extlibs `
tobi at mordor:~/workspace/test$ netcat -l -p 12345 &
[1] 2124
tobi at mordor:~/workspace/test$ ./a.out
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
tobi at mordor:~/workspace/test$ g++ test_noreceive.cpp `ccgnu2-config --flags --libs --includes --extlibs `
[1]+ Done netcat -l -p 12345
tobi at mordor:~/workspace/test$ netcat -l -p 12345 &
[1] 2151
tobi at mordor:~/workspace/test$ ./a.out
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
[1]+ Done netcat -l -p 12345
tobi at mordor:~/workspace/test$
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.29-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libcommoncpp2-dev depends on:
ii libccgnu2-1.7-0 1.7.3-1 A GNU package for creating portabl
ii libgcrypt11-dev [libgc 1.4.4-2 LGPL Crypto library - development
ii libgnutls-dev 2.6.6-1 the GNU TLS library - development
ii pkg-config 0.22-1 manage compile and link flags for
ii zlib1g-dev 1:1.2.3.3.dfsg-13 compression library - development
libcommoncpp2-dev recommends no packages.
Versions of packages libcommoncpp2-dev suggests:
ii libcommoncpp2-doc 1.7.3-1 Documentation files for Common C++
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c
Size: 1249 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20090607/4b6a6fbe/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_noreceive.cpp
Type: text/x-c
Size: 1251 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20090607/4b6a6fbe/attachment-0001.bin>
More information about the Pkg-voip-maintainers
mailing list