Removed duplicate code encode/send and decode/recv, Added recv_nowait method