2 * Copyright (C) ARM Limited 2010-2013. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #ifndef __OLY_SOCKET_H__
10 #define __OLY_SOCKET_H__
16 OlySocket(int port, bool multipleConnections = false);
17 OlySocket(int port, char* hostname);
19 int acceptConnection();
21 void closeServerSocket();
22 void shutdownConnection();
23 void send(char* buffer, int size);
24 void sendString(const char* string) {send((char*)string, strlen(string));}
25 int receive(char* buffer, int size);
26 int receiveNBytes(char* buffer, int size);
27 int receiveString(char* buffer, int size);
28 int getSocketID() {return mSocketID;}
30 int mSocketID, mFDServer;
31 void createClientSocket(char* hostname, int port);
32 void createSingleServerConnection(int port);
33 void createServerSocket(int port);
36 #endif //__OLY_SOCKET_H__