aboutsummaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-28 22:47:03 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-28 22:47:03 +0000
commitf896b0e207e0b656109ef0e9f721f27ce53a836e (patch)
tree1e93590ef779bd4d443a6dc302564c6673012afb /src/socket.cpp
parentafb50f535dd60b485a38f1f1f692b3303e28fecc (diff)
downloadlibbu++-f896b0e207e0b656109ef0e9f721f27ce53a836e.tar.gz
libbu++-f896b0e207e0b656109ef0e9f721f27ce53a836e.tar.bz2
libbu++-f896b0e207e0b656109ef0e9f721f27ce53a836e.tar.xz
libbu++-f896b0e207e0b656109ef0e9f721f27ce53a836e.zip
Client code is better, so is the socket, you can get addresses and other cool
things from it. The plugger had yet another bugfix...plugger...
Diffstat (limited to '')
-rw-r--r--src/socket.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index bd05024..5a3097c 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -276,3 +276,15 @@ bool Bu::Socket::isOpen()
276 return bActive; 276 return bActive;
277} 277}
278 278
279Bu::FString Bu::Socket::getAddress() const
280{
281 struct sockaddr_in addr;
282 socklen_t len = sizeof(addr);
283 addr.sin_family = AF_INET;
284 getsockname( nSocket, (sockaddr *)(&addr), &len );
285 char buf[150];
286 sprintf( buf, "%s", inet_ntoa( addr.sin_addr ) );
287
288 return buf;
289}
290