I have enabled "BOOST_ASIO_ENABLE_HANDLER_TRACKING" and checked what is happening... The relevant and partial output is given below...
This output is for a buffer of 32KB in size.
@asio|1437455926.606762|9*10|socket@0xb6601154.async_send
@asio|1437455926.606885|<9|
@asio|1437455926.606910|>10|ec=system:0,bytes_transferred=28960
@asio|1437455926.606930|10*11|socket@0xb6601154.async_send
@asio|1437455926.606940|<10|
@asio|1437455926.608395|>11|ec=system:0,bytes_transferred=3808
//**** Here it enters my write handler *****//
@asio|1437455926.620076|11*12|socket@0xb6601154.async_send
@asio|1437455926.620211|<11|
@asio|1437455926.620224|>12|ec=system:0,bytes_transferred=32768
//**** Here it enters my write handler *****//
@asio|1437455926.620451|12*13|socket@0xb6601154.async_send
@asio|1437455926.620486|<12|
@asio|1437455926.620496|>13|ec=system:0,bytes_transferred=16464
@asio|1437455926.620505|13*14|socket@0xb6601154.async_send
@asio|1437455926.620515|<13|
@asio|1437455926.622322|>14|ec=system:0,bytes_transferred=16304
//**** Here it enters my write handler *****//
@asio|1437455926.622549|14*15|socket@0xb6601154.async_send
@asio|1437455926.622573|<14|
@asio|1437455926.622588|>15|ec=system:0,bytes_transferred=5416
@asio|1437455926.622597|15*16|socket@0xb6601154.async_send
@asio|1437455926.622617|<15|
@asio|1437455926.622626|>16|ec=system:0,bytes_transferred=4344
@asio|1437455926.622635|16*17|socket@0xb6601154.async_send
@asio|1437455926.622645|<16|
@asio|1437455926.624319|>17|ec=system:0,bytes_transferred=18824
@asio|1437455926.624341|17*18|socket@0xb6601154.async_send
@asio|1437455926.624354|<17|
It has so much data more to be written, but the handler (18) is not getting called! In the documentation it is stated that "async_write" is a composed operation of "async_write_some". But here it seems it is using "async_send". The code works as expected in windows! I am using Ubuntu 14.4 LTS.
Can anybody give some hint to debug this issue?
Thanks a lot,
Lloyd