ns-3 Direct Code Execution
Home
Tutorials ▼
Docs ▼
Wiki
Manual
Develop ▼
API
Bugs
API
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
unix-stream-socket-fd.h
Go to the documentation of this file.
1
#ifndef UNIX_STREAM_SOCKET_FD_H
2
#define UNIX_STREAM_SOCKET_FD_H
3
4
#include "
unix-socket-fd.h
"
5
#include <list>
6
7
namespace
ns3 {
8
9
class
UnixStreamSocketFd
:
public
UnixSocketFd
10
{
11
public
:
12
UnixStreamSocketFd
(Ptr<Socket> sock,
bool
connected = 0);
13
virtual
~UnixStreamSocketFd
(
void
);
14
private
:
15
enum
State
16
{
17
CREATED
,
18
// BINDED,
19
LISTENING
,
20
// ACCEPTING,
21
CONNECTING
,
22
CONNECTED
,
23
REMOTECLOSED
,
24
CLOSING
,
// wait for socket close callback
25
CLOSED
26
};
27
virtual
int
Close
(
void
);
28
virtual
ssize_t
DoRecvmsg
(
struct
msghdr *msg,
int
flags);
29
virtual
ssize_t
DoSendmsg
(
const
struct
msghdr *msg,
int
flags);
30
virtual
int
Listen
(
int
backlog);
31
virtual
int
Accept
(
struct
sockaddr *my_addr, socklen_t *addrlen);
32
virtual
int
Shutdown
(
int
how);
33
virtual
bool
CanRecv
(
void
)
const
;
34
virtual
bool
CanSend
(
void
)
const
;
35
virtual
bool
HangupReceived
(
void
)
const
;
36
virtual
int
Connect
(
const
struct
sockaddr *my_addr, socklen_t addrlen);
37
virtual
int
Getpeername
(
struct
sockaddr *name, socklen_t *namelen);
38
virtual
int
Poll
(
PollTable
* ptable);
39
40
bool
ConnectionRequest
(Ptr<Socket> sock,
const
Address & from);
41
void
ConnectionCreated
(Ptr<Socket> sock,
const
Address & from);
42
43
void
ConnectionSuccess
(Ptr<Socket> sock);
44
void
ConnectionError
(Ptr<Socket> sock);
45
46
void
CloseSuccess
(Ptr<Socket> sock);
47
void
CloseError
(Ptr<Socket> sock);
48
49
void
SetPeerAddress
(Address *a);
50
51
void
MainSend
(
int
*r, Ptr<Packet> p);
52
53
std::list<std::pair<Ptr<Socket>,Address> >
m_connectionQueue
;
54
int
m_backlog
;
55
State
m_state
;
56
Address*
m_peerAddress
;
57
bool
m_shutWrite
;
58
};
59
60
}
// namespace ns3
61
62
#endif
/* UNIX_STREAM_SOCKET_FD_H */
model
unix-stream-socket-fd.h
Generated on Fri Aug 30 2013 13:57:56 for ns-3-dce by
1.8.1.2