aboutsummaryrefslogtreecommitdiff
path: root/src/udpsocket.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/udpsocket.h
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to 'src/udpsocket.h')
-rw-r--r--src/udpsocket.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/udpsocket.h b/src/udpsocket.h
index 253839a..8fe114d 100644
--- a/src/udpsocket.h
+++ b/src/udpsocket.h
@@ -1,3 +1,10 @@
1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
1#ifndef BU_UDP_SOCKET_H 8#ifndef BU_UDP_SOCKET_H
2#define BU_UDP_SOCKET_H 9#define BU_UDP_SOCKET_H
3 10
@@ -13,24 +20,24 @@ namespace Bu
13 { 20 {
14 public: 21 public:
15 UdpSocket( int iUdpSocket ); 22 UdpSocket( int iUdpSocket );
16 UdpSocket( const Bu::FString &sAddr, int iPort, int iFlags ); 23 UdpSocket( const Bu::String &sAddr, int iPort, int iFlags );
17 virtual ~UdpSocket(); 24 virtual ~UdpSocket();
18 25
19 typedef uint32_t addr; 26 typedef uint32_t addr;
20 27
21 static Bu::FString addrToStr( const addr &a ); 28 static Bu::String addrToStr( const addr &a );
22 29
23 virtual void close(); 30 virtual void close();
24 virtual size_t read( void *pBuf, size_t nBytes ); 31 virtual Bu::size read( void *pBuf, Bu::size nBytes );
25 virtual size_t read( void *pBuf, size_t nBytes, 32 virtual Bu::size read( void *pBuf, Bu::size nBytes,
26 addr &sHost, int &iPort ); 33 addr &sHost, int &iPort );
27 virtual size_t write( const void *pBuf, size_t nBytes ); 34 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
28 using Stream::write; 35 using Stream::write;
29 36
30 virtual long tell(); 37 virtual Bu::size tell();
31 virtual void seek( long offset ); 38 virtual void seek( Bu::size offset );
32 virtual void setPos( long pos ); 39 virtual void setPos( Bu::size pos );
33 virtual void setPosEnd( long pos ); 40 virtual void setPosEnd( Bu::size pos );
34 virtual bool isEos(); 41 virtual bool isEos();
35 virtual bool isOpen(); 42 virtual bool isOpen();
36 43
@@ -46,7 +53,7 @@ namespace Bu
46 virtual bool isBlocking(); 53 virtual bool isBlocking();
47 virtual void setBlocking( bool bBlocking=true ); 54 virtual void setBlocking( bool bBlocking=true );
48 55
49 virtual void setSize( long iSize ); 56 virtual void setSize( Bu::size iSize );
50 57
51 enum { 58 enum {
52 // Flags 59 // Flags
@@ -56,6 +63,9 @@ namespace Bu
56 Broadcast = 0x04, ///< Open for broadcast 63 Broadcast = 0x04, ///< Open for broadcast
57 }; 64 };
58 65
66 virtual size getSize() const;
67 virtual size getBlockSize() const;
68 virtual Bu::String getLocation() const;
59 69
60 private: 70 private:
61#ifdef WIN32 71#ifdef WIN32