Discussion:
[asio-users] How to implement my own TCP?
Chengu Wang
2013-02-16 06:59:26 UTC
Permalink
Hi all,

I'd like to implement the TCP over UDP, because I want to change TCP a
little. The implementation includes the three-way handshake,
retransmission, etc.

My TCP must have the basic interfaces as the original TCP does, i.e. a
my_tcp::acceptor class supporting bind, listen, accept, async_accept and
close, and a my_tcp::socket supporting bind, connect, async_connect, send,
async_send, receive, async_receive and close.

Of course I can write these two classes from scratch, but can I do it in
the framework of asio and reuse some codes of asio? What classes should I
implement and what do the inherit from?

Any help would be appreciated.
--
Best,

Chengu Wang
svante karlsson
2013-02-16 12:42:32 UTC
Permalink
TCP is not implemented in ASIO and thus you cant really use the code
to extend it. If you really want to reimplement TCP you might want to
take a look at some of the embedded tcp stacks that exists.

A better approach is probably to understand that you are implementing
your own "safe UDP" protocol and start on that using ASIO UDP. But
then again, ask yourself, why?

/svante
Post by Chengu Wang
Hi all,
I'd like to implement the TCP over UDP, because I want to change TCP a
little. The implementation includes the three-way handshake, retransmission,
etc.
My TCP must have the basic interfaces as the original TCP does, i.e. a
my_tcp::acceptor class supporting bind, listen, accept, async_accept and
close, and a my_tcp::socket supporting bind, connect, async_connect, send,
async_send, receive, async_receive and close.
Of course I can write these two classes from scratch, but can I do it in the
framework of asio and reuse some codes of asio? What classes should I
implement and what do the inherit from?
Any help would be appreciated.
--
Best,
Chengu Wang
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
is your hub for all things parallel software development, from weekly
thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
asio-users mailing list
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
Chengu Wang
2013-02-16 13:07:38 UTC
Permalink
Hi Svante,

Thanks for you suggestions.

I don't want to reuse the codes in OS implementing TCP, but I hope to use
some codes in Asio, e.g. basic_stream_socket, reactive_socket_service_base,
buffer_sequence_adapter, reactor_op, task_io_service_operation etc.

I implemented TCP again because I want to change the retransmission
mechanism to make TCP faster.
Post by svante karlsson
TCP is not implemented in ASIO and thus you cant really use the code
to extend it. If you really want to reimplement TCP you might want to
take a look at some of the embedded tcp stacks that exists.
A better approach is probably to understand that you are implementing
your own "safe UDP" protocol and start on that using ASIO UDP. But
then again, ask yourself, why?
/svante
Post by Chengu Wang
Hi all,
I'd like to implement the TCP over UDP, because I want to change TCP a
little. The implementation includes the three-way handshake,
retransmission,
Post by Chengu Wang
etc.
My TCP must have the basic interfaces as the original TCP does, i.e. a
my_tcp::acceptor class supporting bind, listen, accept, async_accept and
close, and a my_tcp::socket supporting bind, connect, async_connect,
send,
Post by Chengu Wang
async_send, receive, async_receive and close.
Of course I can write these two classes from scratch, but can I do it in
the
Post by Chengu Wang
framework of asio and reuse some codes of asio? What classes should I
implement and what do the inherit from?
Any help would be appreciated.
--
Best,
Chengu Wang
------------------------------------------------------------------------------
Post by Chengu Wang
The Go Parallel Website, sponsored by Intel - in partnership with
Geeknet,
Post by Chengu Wang
is your hub for all things parallel software development, from weekly
thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now.
http://goparallel.sourceforge.net/
Post by Chengu Wang
_______________________________________________
asio-users mailing list
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
is your hub for all things parallel software development, from weekly
thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now.
http://goparallel.sourceforge.net/
_______________________________________________
asio-users mailing list
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
--
Best,

Chengu Wang
niXman
2013-02-16 13:12:34 UTC
Permalink
Post by Chengu Wang
I'd like to implement the TCP over UDP
Hi,

Why not use UDT project?:
http://udt.sourceforge.net/
--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows:
http://sourceforge.net/projects/mingwbuilds/
___________________________________________________
Another online IDE: http://liveworkspace.org/
Chengu Wang
2013-02-16 13:23:46 UTC
Permalink
Hi niXman,

I know this project. Thanks. UDT is a good choice as well. I will choose
UDT if the async functions are difficult to implement in Asio framework.
The TCP protocol itself is not a problem.
Post by niXman
Post by Chengu Wang
I'd like to implement the TCP over UDP
Hi,
http://udt.sourceforge.net/
--
Regards,
niXman
___________________________________________________
http://sourceforge.net/projects/mingwbuilds/
___________________________________________________
Another online IDE: http://liveworkspace.org/
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
is your hub for all things parallel software development, from weekly
thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now.
http://goparallel.sourceforge.net/
_______________________________________________
asio-users mailing list
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio
--
Best,

Chengu Wang
Loading...