File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Socket \React \Datagram ;
44
5+
56use Socket \React \SelectPoller ;
67use React \Promise \When ;
78use React \Promise \Deferred ;
89use React \EventLoop \LoopInterface ;
910use Socket \Raw \Factory as RawFactory ;
11+ use Socket \Raw \Socket as RawSocket ;
1012use \Exception ;
1113
1214class Factory
@@ -95,6 +97,21 @@ public function createUdg()
9597 return new Datagram ($ this ->rawFactory ->createUdg (), $ this ->getPoller ());
9698 }
9799
100+ public function createIcmp4 ()
101+ {
102+ return $ this ->createFromRaw ($ this ->rawFactory ->createIcmp4 ());
103+ }
104+
105+ public function createIcmp6 ()
106+ {
107+ return $ this ->createFromRaw ($ this ->rawFactory ->createIcmp4 ());
108+ }
109+
110+ public function createFromRaw (RawSocket $ rawSocket )
111+ {
112+ return new Datagram ($ rawSocket , $ this ->getPoller ());
113+ }
114+
98115 /**
99116 *
100117 * @return SelectPoller
You can’t perform that action at this time.
0 commit comments