gambas-source-code/gb.net/src/CServerSocket.h
gambas 5ee3fbbeee Add a tag property to the ServerSocket class, and save a few bytes in Socket and ServerSocket internal structures.
[GB.NET]
* NEW: ServerSocket: Add a tag property.
* OPT: Socket: Remove a duplicated 'path' field and save a few bytes in Socket structure.
* OPT: ServerSocket: Save a few bytes in the ServerSocket structure.
2021-05-22 00:07:40 +02:00

71 lines
1.6 KiB
C

/***************************************************************************
CServerSocket.h
(c) 2003-2004 Daniel Campos Fernández <dcamposf@gmail.com>
This program 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, or (at your option)
any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
***************************************************************************/
#ifndef __CSERVERSOCKET_H
#define __CSERVERSOCKET_H
#include "gambas.h"
#include "CNet.h"
#include "CSocket.h"
#ifndef __CSERVERSOCKET_C
extern GB_DESC CServerSocketDesc[];
#else
#define THIS ((CSERVERSOCKET *)_object)
#define SOCKET (&THIS->common)
#endif
typedef
union
{
struct sockaddr_in in;
struct sockaddr_un un;
}
st_so_sock;
typedef
struct
{
CSOCKET_COMMON common;
unsigned type : 2;
unsigned pause : 1;
unsigned short port;
char *path;
int num_conn;
int max_conn;
st_so_sock so_server;
st_so_sock so_client;
int client;
CSOCKET **children;
char *interface;
GB_VARIANT_VALUE tag;
}
CSERVERSOCKET;
#endif