* The KDL command "udp_endpoints" did not work anymore, since
DatagramSocket::AvailableData() locks; introduced a UdpEndpoint::Dump() method to work around that. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38355 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -101,12 +101,14 @@ public:
|
||||
|
||||
UdpEndpoint*& HashTableLink() { return fLink; }
|
||||
|
||||
void Dump() const;
|
||||
|
||||
private:
|
||||
UdpDomainSupport* fManager;
|
||||
bool fActive;
|
||||
// an active UdpEndpoint is part of the
|
||||
// endpoint hash (and it is bound and optionally
|
||||
// connected)
|
||||
// endpoint hash (and it is bound and
|
||||
// optionally connected)
|
||||
|
||||
UdpEndpoint* fLink;
|
||||
};
|
||||
@@ -400,15 +402,8 @@ UdpDomainSupport::DumpEndpoints() const
|
||||
|
||||
EndpointTable::Iterator it = fActiveEndpoints.GetIterator();
|
||||
|
||||
while (it.HasNext()) {
|
||||
UdpEndpoint *endpoint = it.Next();
|
||||
|
||||
char localBuf[64], peerBuf[64];
|
||||
endpoint->LocalAddress().AsString(localBuf, sizeof(localBuf), true);
|
||||
endpoint->PeerAddress().AsString(peerBuf, sizeof(peerBuf), true);
|
||||
|
||||
kprintf("%p %20s %20s %8lu\n", endpoint, localBuf, peerBuf,
|
||||
endpoint->AvailableData());
|
||||
while (UdpEndpoint* endpoint = it.Next()) {
|
||||
endpoint->Dump();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +874,11 @@ UdpEndpointManager::_GetDomain(net_buffer* buffer)
|
||||
|
||||
|
||||
UdpEndpoint::UdpEndpoint(net_socket *socket)
|
||||
: DatagramSocket<>("udp endpoint", socket), fActive(false) {}
|
||||
:
|
||||
DatagramSocket<>("udp endpoint", socket),
|
||||
fActive(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - activation
|
||||
@@ -1009,7 +1008,7 @@ UdpEndpoint::FetchData(size_t numBytes, uint32 flags, net_buffer **_buffer)
|
||||
TRACE_EP("FetchData(%ld, 0x%lx)", numBytes, flags);
|
||||
|
||||
status_t status = Dequeue(flags, _buffer);
|
||||
TRACE_EP(" FetchData(): returned from fifo status=0x%lx", status);
|
||||
TRACE_EP(" FetchData(): returned from fifo status: %s", strerror(status));
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
@@ -1046,6 +1045,18 @@ UdpEndpoint::DeliverData(net_buffer *_buffer)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UdpEndpoint::Dump() const
|
||||
{
|
||||
char local[64];
|
||||
LocalAddress().AsString(local, sizeof(local), true);
|
||||
char peer[64];
|
||||
PeerAddress().AsString(peer, sizeof(peer), true);
|
||||
|
||||
kprintf("%p %20s %20s %8lu\n", this, local, peer, fCurrentBytes);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - protocol interface
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user