@@ -13,25 +13,21 @@ public class GSocket extends GObject{
1313
1414 public static final String GTYPE_NAME = "GSocket" ;
1515
16- public static GSocket create (GSocketFamily family , GSocketType type , GSocketProtocol protocol ) throws GstException {
16+ public static Initializer makeRawSocket (GSocketFamily family , GSocketType type , GSocketProtocol protocol ) throws GstException {
1717 GErrorStruct reference = new GErrorStruct ();
1818 GErrorStruct [] errorArray = (GErrorStruct []) reference .toArray (1 );
1919 Pointer socketPointer = GioAPI .g_socket_new (family .toGioValue (), type .toGioValue (), protocol .toGioValue (), reference .getPointer ());
2020 if (socketPointer == null ) {
2121 errorArray [0 ].read ();
2222 throw new GstException (new GError (errorArray [0 ]));
2323 }
24- return new GSocket ( initializer (socketPointer ) );
24+ return initializer (socketPointer );
2525 }
2626
27- public static GSocket createDefaultUdpSocket () {
28- return create ( GSocketFamily . IPV4 , GSocketType . DATAGRAM , GSocketProtocol . UDP );
27+ public GSocket ( GSocketFamily family , GSocketType type , GSocketProtocol protocol ) throws GstException {
28+ this ( makeRawSocket ( family , type , protocol ) );
2929 }
30-
31- public static GSocket createDefaultUdpSocket (String bindAddress , int bindPort ) {
32- return create (GSocketFamily .IPV4 , GSocketType .DATAGRAM , GSocketProtocol .UDP ).bind (bindAddress , bindPort );
33- }
34-
30+
3531 public GSocket (Initializer init ) {
3632 super (init );
3733 }
0 commit comments