2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2004-07-04 17:41:17 +02:00
|
|
|
#include "precompiled.h"
|
|
|
|
|
2003-11-25 03:11:50 +01:00
|
|
|
#include "Network.h"
|
2005-02-21 18:13:31 +01:00
|
|
|
#include "NetLog.h"
|
2003-11-25 03:11:50 +01:00
|
|
|
|
|
|
|
CServerSocket::~CServerSocket()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CServerSocket::OnRead()
|
|
|
|
{
|
2004-03-08 03:08:12 +01:00
|
|
|
CSocketAddress remoteAddr;
|
2003-11-25 03:11:50 +01:00
|
|
|
|
|
|
|
PS_RESULT res=PreAccept(remoteAddr);
|
|
|
|
if (res==PS_OK)
|
|
|
|
{
|
|
|
|
OnAccept(remoteAddr);
|
|
|
|
}
|
2005-01-17 05:52:02 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// All errors are non-critical, so no need to do anything special besides
|
|
|
|
// not calling OnAccept [ shouldn't be, that is ;-) ]
|
2007-10-13 17:17:50 +02:00
|
|
|
NET_LOG2( "CServerSocket::OnRead(): PreAccept returned an error: %s", res );
|
2005-01-17 05:52:02 +01:00
|
|
|
}
|
2003-11-25 03:11:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CServerSocket::OnWrite()
|
|
|
|
{}
|
|
|
|
|
2005-08-09 17:55:44 +02:00
|
|
|
void CServerSocket::OnClose(PS_RESULT UNUSED(errorCode))
|
2003-11-25 03:11:50 +01:00
|
|
|
{}
|