Example #1
0
extern "C" int evma_get_sockname (const unsigned long binding, struct sockaddr *sa)
{
	ensure_eventmachine("evma_get_sockname");
	EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
	if (ed) {
		return ed->GetSockname (sa) ? 1 : 0;
	}
	else
		return 0;
}
Example #2
0
extern "C" int evma_get_sockname (const char *binding, struct sockaddr *sa)
{
	if (!EventMachine)
		throw std::runtime_error ("not initialized");
	EventableDescriptor *ed = dynamic_cast <EventableDescriptor*> (Bindable_t::GetObject (binding));
	if (ed) {
		return ed->GetSockname (sa) ? 1 : 0;
	}
	else
		return 0;
}