]> git.sesse.net Git - vlc/commitdiff
Inline net_ListenTCP
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 14 Feb 2007 18:43:27 +0000 (18:43 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 14 Feb 2007 18:43:27 +0000 (18:43 +0000)
include/vlc_network.h
src/network/tcp.c

index ab4b60e8cae06095fa46d82af337d9f75be46737..16e2c1bcbc0c66b4a29f5ca23bea8e2f7c964e57 100644 (file)
@@ -74,12 +74,15 @@ int net_Socket (vlc_object_t *obj, int family, int socktype, int proto);
 #define net_OpenTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
 VLC_EXPORT( int, __net_ConnectTCP, ( vlc_object_t *p_this, const char *psz_host, int i_port ) );
 
-int *net_Listen (vlc_object_t *p_this, const char *psz_host, int i_port,
-                                int family, int socktype, int protocol);
+VLC_EXPORT( int *, net_Listen, (vlc_object_t *p_this, const char *psz_host, int i_port,
+                                int family, int socktype, int protocol) );
 VLC_EXPORT( int, net_ListenSingle, (vlc_object_t *p_this, const char *psz_host, int i_port, int family, int socktype, int protocol) );
 
 #define net_ListenTCP(a, b, c) __net_ListenTCP(VLC_OBJECT(a), b, c)
-VLC_EXPORT( int *, __net_ListenTCP, ( vlc_object_t *, const char *, int ) );
+static inline int *__net_ListenTCP ( vlc_object_t *obj, const char *host, int port)
+{
+    return net_Listen (obj, host, port, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
+}
 
 #define net_Accept(a, b, c) __net_Accept(VLC_OBJECT(a), b, c)
 VLC_EXPORT( int, __net_Accept, ( vlc_object_t *, int *, mtime_t ) );
@@ -89,7 +92,7 @@ VLC_EXPORT( int, __net_ConnectDgram, ( vlc_object_t *p_this, const char *psz_hos
 
 static inline int net_ConnectUDP (vlc_object_t *obj, const char *host, int port, int hlim)
 {
-    return net_ConnectDgram (obj, host, port, hlim, 0);
+    return net_ConnectDgram (obj, host, port, hlim, IPPROTO_UDP);
 }
 
 static inline int net_ListenUDP1 (vlc_object_t *obj, const char *host, int port)
index 6b2a17d8ebb2833123a56bb944fff1de99f4378b..e7cf2018af112c19003012e223e9b69e05bc89d9 100644 (file)
@@ -259,18 +259,6 @@ next_ai: /* failure */
 }
 
 
-/*****************************************************************************
- * __net_ListenTCP:
- *****************************************************************************
- * Open TCP passive "listening" socket(s)
- * This function returns NULL in case of error.
- *****************************************************************************/
-int *__net_ListenTCP (vlc_object_t *p_this, const char *psz_host, int i_port)
-{
-    return net_Listen (p_this, psz_host, i_port, AF_UNSPEC, SOCK_STREAM,
-                       IPPROTO_TCP);
-}
-
 /*****************************************************************************
  * __net_Accept:
  *****************************************************************************