File: network.cc

package info (click to toggle)
simutrans 102.2.2~ds1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,540 kB
  • ctags: 10,505
  • sloc: cpp: 85,535; ansic: 3,224; makefile: 510; sh: 40
file content (104 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "network.h"

/**
 * Initializes the network core (as that is needed for some platforms
 * @return true if the core has been initialized, false otherwise
 */
bool network_initialize()
{
	return false;
}



// open a socket or give a decent error message
const char *network_open_address( const char *, SOCKET & )
{
	return "Cannot init network!";
}



// if sucessful, starts a server on this port
bool network_init_server( int  )
{
	return false;
}



void network_add_client( SOCKET  )
{
}

static void network_remove_client( SOCKET  )
{
}

// number of currently active clients
int network_get_clients()
{
	return 0;
}


/* do appropriate action for network server:
 * - either connect to a new client
 * - recieve commands
 */
SOCKET network_check_activity(int , char *, int & )
{
	return INVALID_SOCKET;
}



bool network_check_server_connection()
{
	return false;
}




// send data to all clients
void network_send_all(char *, int , bool  )
{
}



// send data to server
void network_send_server(char *, int  )
{
}



const char *network_send_file( SOCKET , const char * )
{
	return "Client closed connection during transfer";
}



const char *network_recieve_file( SOCKET , const char *, const long  )
{
	return "No connection";
}



void network_close_socket( SOCKET  )
{
}



/**
 * Shuts down the network core (since that is needed for some platforms
 */
void network_core_shutdown()
{
}