changes to echo example's internal API
extract socket write buffer API from echo example