예제 #1
0
/** -------------------------------------------------------------------------
 * Create a UDP socket and return it.
 * \param   L  The lua state.
 * \lparam  port   the port for the socket.
 * \lparam  ip     the IP address for the socket.
 * \lreturn socket Lua UserData wrapped socket.
 * \return  int    # of values pushed onto the stack.
 *-------------------------------------------------------------------------*/
int
lt_net_udp_New( lua_State *L )
{
	struct t_net   __attribute__ ((unused)) *s;

	s = t_net_create_ud( L, T_NET_UDP, 1 );

	return 1 ;
}
예제 #2
0
파일: t_net_udp.c 프로젝트: tobbik/lua-t
/**--------------------------------------------------------------------------
 * Construct a UDP Socket and return it.
 * \param   L      Lua state.
 * \lparam  CLASS  table T.Net.UDP
 * \lreturn ud     t_net_udp userdata instance( socket ).
 * \return  int    # of values pushed onto the stack.
 * --------------------------------------------------------------------------*/
static int
lt_net_udp__Call( lua_State *L )
{
	struct t_net   __attribute__ ((unused)) *s;

	lua_remove( L, 1 );
	s = t_net_create_ud( L, T_NET_UDP, 1 );
	return 1 ;
}