ovr_sdk

view LibOVR/Src/Net/OVR_Socket.cpp @ 0:1b39a1b46319

initial 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:16 +0200
parents
children
line source
1 /************************************************************************************
3 Filename : OVR_Socket.cpp
4 Content : Socket common data shared between all platforms.
5 Created : June 10, 2014
6 Authors : Kevin Jenkins, Chris Taylor
8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
10 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
12 which is provided at the time of installation or download, or which
13 otherwise accompanies this software in either electronic or hard copy form.
15 You may obtain a copy of the License at
17 http://www.oculusvr.com/licenses/LICENSE-3.2
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
25 ************************************************************************************/
27 #include "OVR_Socket.h"
29 namespace OVR { namespace Net {
32 //-----------------------------------------------------------------------------
33 // Socket
35 Socket::Socket() :
36 Transport(TransportType_None)
37 {
38 }
41 //-----------------------------------------------------------------------------
42 // BerkleyBindParameters
44 BerkleyBindParameters::BerkleyBindParameters() :
45 Port(0),
46 Address(),
47 blockingTimeout(0x7fffffff)
48 {
49 }
51 //-----------------------------------------------------------------------------
52 // BerkleySocket
54 BerkleySocket::BerkleySocket() :
55 TheSocket(INVALID_SOCKET)
56 //TimeoutUsec(0) // Initialized by SetBlockingTimeout
57 //TimeoutSec(0) // "
58 {
59 SetBlockingTimeout(1000);
60 }
62 BerkleySocket::~BerkleySocket()
63 {
64 // Close socket on destruction
65 Close();
66 }
69 //-----------------------------------------------------------------------------
70 // UDPSocketBase
72 UDPSocketBase::UDPSocketBase()
73 {
74 Transport = TransportType_UDP;
75 }
78 //-----------------------------------------------------------------------------
79 // TCPSocketBase
81 TCPSocketBase::TCPSocketBase()
82 : IsListenSocket(false)
83 {
84 Transport = TransportType_TCP;
85 }
87 TCPSocketBase::TCPSocketBase(SocketHandle handle)
88 : IsListenSocket(false)
89 {
90 TheSocket = handle;
91 }
94 }} // OVR::Net