[Ns-developers] [ns3] a synchronous socket/posix API
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Sat Apr 5 21:39:05 PDT 2008
On Fri, 2008-04-04 at 15:20 -0700, Mathieu Lacage wrote:
> The example application defines two posix "processes": the function
> ClientProgram creates a udp socket on the localhost port 2000 and the
> function ServerProgram creates a udp socket on the localhost port 2000.
> The code does not work right now because I did not get the details of
> simu_read right yet but, I do plan to make this work at some point.
The example program works now for demonstration purposes (see
examples/process.cc).
Writing this code did raise a few questions:
- I have implemented the udp rx packet buffer outside of the UdpSocket
class in the posix wrapper code. For tcp, I will have to implement an rx
byte buffer, most likely outside of the TcpSocket class too and in the
posix wrapper code.
- for udp sockets, there is no tx buffer, but, should we have one ?
- for tcp sockets, there is an infinite packet tx buffer within the
TcpSocket class and raj agreed to convert it to a finite buffer. I
wonder if it would make sense or be possible to move this tx buffer
outside of the socket implementation and into the posix wrapper code to
be consistent with the rx buffer. I am not sure that this would make
much sense, or that it would be a good idea but, I wanted to mention it
here for completeness.
The next items on the TODO:
- cleanup error handling and errno definitions
- add missing udp socket functions
- maybe implement a tcp socket ?
- implement raw sockets
- add a simu_pthread implementation with simu_sem_t and simu_mutex_t
- add a posix signal implementation
I most likely won't be able to work on much of any of these items over
next week but, I guess that the above would be a pretty good TODO for a
gsoc application :)
Mathieu
More information about the Ns-developers
mailing list