|
|
| 102 |
* \returns the node this socket is associated with. |
102 |
* \returns the node this socket is associated with. |
| 103 |
*/ |
103 |
*/ |
| 104 |
virtual Ptr<Node> GetNode (void) const = 0; |
104 |
virtual Ptr<Node> GetNode (void) const = 0; |
| 105 |
|
|
|
| 106 |
/** |
| 107 |
* \param closeCompleted Callback invoked when the close operation is |
| 108 |
* completed. |
| 109 |
*/ |
| 110 |
void SetCloseCallback (Callback<void, Ptr<Socket> > closeCompleted); |
| 111 |
/** |
105 |
/** |
| 112 |
* \param connectionSucceeded this callback is invoked when the |
106 |
* \param connectionSucceeded this callback is invoked when the |
| 113 |
* connection request initiated by the user is successfully |
107 |
* connection request initiated by the user is successfully |
|
|
| 117 |
* connection request initiated by the user is unsuccessfully |
111 |
* connection request initiated by the user is unsuccessfully |
| 118 |
* completed. The callback is passed back a pointer to the |
112 |
* completed. The callback is passed back a pointer to the |
| 119 |
* same socket object. |
113 |
* same socket object. |
| 120 |
* \param halfClose XXX When exactly is this callback invoked? If |
|
|
| 121 |
* it invoked when the other side closes the connection ? |
| 122 |
* Or when I call Close ? |
| 123 |
*/ |
114 |
*/ |
| 124 |
void SetConnectCallback (Callback<void, Ptr<Socket> > connectionSucceeded, |
115 |
void SetConnectCallback (Callback<void, Ptr<Socket> > connectionSucceeded, |
| 125 |
Callback<void, Ptr<Socket> > connectionFailed, |
116 |
Callback<void, Ptr<Socket> > connectionFailed); |
| 126 |
Callback<void, Ptr<Socket> > halfClose); |
|
|
| 127 |
/** |
117 |
/** |
| 128 |
* \brief Accept connection requests from remote hosts |
118 |
* \brief Accept connection requests from remote hosts |
| 129 |
* \param connectionRequest Callback for connection request from peer. |
119 |
* \param connectionRequest Callback for connection request from peer. |
|
|
| 140 |
* back to the user through this callback. This user callback is |
130 |
* back to the user through this callback. This user callback is |
| 141 |
* passed a pointer to the new socket, and the ip address and |
131 |
* passed a pointer to the new socket, and the ip address and |
| 142 |
* port number of the connection originator. |
132 |
* port number of the connection originator. |
| 143 |
* \param closeRequested Callback for connection close request from peer. |
|
|
| 144 |
* XXX: when is this callback invoked ? |
| 145 |
*/ |
133 |
*/ |
| 146 |
void SetAcceptCallback (Callback<bool, Ptr<Socket>, |
134 |
void SetAcceptCallback (Callback<bool, Ptr<Socket>, |
| 147 |
const Address &> connectionRequest, |
135 |
const Address &> connectionRequest, |
| 148 |
Callback<void, Ptr<Socket>, |
136 |
Callback<void, Ptr<Socket>, |
| 149 |
const Address&> newConnectionCreated, |
137 |
const Address&> newConnectionCreated); |
| 150 |
Callback<void, Ptr<Socket> > closeRequested); |
|
|
| 151 |
/** |
138 |
/** |
| 152 |
* \brief Notify application when a packet has been sent from transport |
139 |
* \brief Notify application when a packet has been sent from transport |
| 153 |
* protocol (non-standard socket call) |
140 |
* protocol (non-standard socket call) |
|
|
| 509 |
Address &fromAddress); |
496 |
Address &fromAddress); |
| 510 |
|
497 |
|
| 511 |
protected: |
498 |
protected: |
| 512 |
void NotifyCloseUnblocks (void); |
|
|
| 513 |
void NotifyCloseCompleted (void); |
| 514 |
void NotifyConnectionSucceeded (void); |
499 |
void NotifyConnectionSucceeded (void); |
| 515 |
void NotifyConnectionFailed (void); |
500 |
void NotifyConnectionFailed (void); |
| 516 |
void NotifyHalfClose (void); |
|
|
| 517 |
bool NotifyConnectionRequest (const Address &from); |
501 |
bool NotifyConnectionRequest (const Address &from); |
| 518 |
void NotifyNewConnectionCreated (Ptr<Socket> socket, const Address &from); |
502 |
void NotifyNewConnectionCreated (Ptr<Socket> socket, const Address &from); |
| 519 |
void NotifyCloseRequested (void); |
|
|
| 520 |
void NotifyDataSent (uint32_t size); |
503 |
void NotifyDataSent (uint32_t size); |
| 521 |
void NotifySend (uint32_t spaceAvailable); |
504 |
void NotifySend (uint32_t spaceAvailable); |
| 522 |
void NotifyDataRecv (void); |
505 |
void NotifyDataRecv (void); |
| 523 |
|
506 |
|
| 524 |
Callback<void, Ptr<Socket> > m_closeUnblocks; |
|
|
| 525 |
Callback<void,Ptr<Socket> > m_closeCompleted; |
| 526 |
Callback<void, Ptr<Socket> > m_connectionSucceeded; |
507 |
Callback<void, Ptr<Socket> > m_connectionSucceeded; |
| 527 |
Callback<void, Ptr<Socket> > m_connectionFailed; |
508 |
Callback<void, Ptr<Socket> > m_connectionFailed; |
| 528 |
Callback<void, Ptr<Socket> > m_halfClose; |
|
|
| 529 |
Callback<void, Ptr<Socket> > m_closeRequested; |
| 530 |
Callback<bool, Ptr<Socket>, const Address &> m_connectionRequest; |
509 |
Callback<bool, Ptr<Socket>, const Address &> m_connectionRequest; |
| 531 |
Callback<void, Ptr<Socket>, const Address&> m_newConnectionCreated; |
510 |
Callback<void, Ptr<Socket>, const Address&> m_newConnectionCreated; |
| 532 |
Callback<void, Ptr<Socket>, uint32_t> m_dataSent; |
511 |
Callback<void, Ptr<Socket>, uint32_t> m_dataSent; |