예제 #1
0
파일: cmain.cpp 프로젝트: mrkn/eventmachine
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;
}
예제 #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;
}