Commit 1398d76e authored by sletz's avatar sletz
Browse files

Add missing method in JackNetWinSocket.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4570 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 0314acf4
This diff is collapsed.
......@@ -23,7 +23,7 @@
#include "JackNetSocket.h"
#ifdef __MINGW32__
#include <winsock2.h>
#include <ws2tcpip.h>
#include <ws2tcpip.h>
#include <stdint.h>
#endif
......@@ -32,9 +32,9 @@ namespace Jack
{
#define E(code, s) { code, s }
#define NET_ERROR_CODE WSAGetLastError()
#define StrError PrintError
#define StrError PrintError
typedef uint32_t uint;
typedef uint32_t uint;
typedef int SOCKLEN;
typedef struct _win_net_error win_net_error_t;
......@@ -44,7 +44,7 @@ namespace Jack
const char* msg;
};
SERVER_EXPORT const char* PrintError ( int error );
SERVER_EXPORT const char* PrintError(int error);
//JeckNetWinSocket***************************************************************************
class SERVER_EXPORT JackNetWinSocket
......@@ -56,53 +56,55 @@ namespace Jack
SOCKADDR_IN fRecvAddr;
public:
JackNetWinSocket();
JackNetWinSocket ( const char* ip, int port );
JackNetWinSocket ( const JackNetWinSocket& );
JackNetWinSocket(const char* ip, int port);
JackNetWinSocket(const JackNetWinSocket&);
~JackNetWinSocket();
JackNetWinSocket& operator= ( const JackNetWinSocket& );
JackNetWinSocket& operator=(const JackNetWinSocket&);
//socket management
int NewSocket();
int Bind();
int BindWith ( const char* ip );
int BindWith ( int port );
int BindWith(const char* ip);
int BindWith(int port);
int Connect();
int ConnectTo ( const char* ip );
int ConnectTo(const char* ip);
void Close();
void Reset();
bool IsSocket();
//IP/PORT management
void SetPort ( int port );
void SetPort(int port);
int GetPort();
//address management
int SetAddress ( const char* ip, int port );
int SetAddress(const char* ip, int port);
char* GetSendIP();
char* GetRecvIP();
//utility
int GetName ( char* name );
int JoinMCastGroup ( const char* mcast_ip );
int GetName(char* name);
int JoinMCastGroup(const char* mcast_ip);
//options management
int SetOption ( int level, int optname, const void* optval, SOCKLEN optlen );
int GetOption ( int level, int optname, void* optval, SOCKLEN* optlen );
int SetOption(int level, int optname, const void* optval, SOCKLEN optlen);
int GetOption(int level, int optname, void* optval, SOCKLEN* optlen);
//timeout
int SetTimeOut ( int usec );
int SetTimeOut(int usec);
//disable local loop
int SetLocalLoop();
bool IsLocal(char* ip) { return false; }
//network operations
int SendTo ( const void* buffer, size_t nbytes, int flags );
int SendTo ( const void* buffer, size_t nbytes, int flags, const char* ip );
int Send ( const void* buffer, size_t nbytes, int flags );
int RecvFrom ( void* buffer, size_t nbytes, int flags );
int Recv ( void* buffer, size_t nbytes, int flags );
int CatchHost ( void* buffer, size_t nbytes, int flags );
int SendTo(const void* buffer, size_t nbytes, int flags);
int SendTo(const void* buffer, size_t nbytes, int flags, const char* ip);
int Send(const void* buffer, size_t nbytes, int flags);
int RecvFrom(void* buffer, size_t nbytes, int flags);
int Recv(void* buffer, size_t nbytes, int flags);
int CatchHost(void* buffer, size_t nbytes, int flags);
//error management
net_error_t GetError();
......@@ -110,3 +112,4 @@ namespace Jack
}
#endif
......@@ -55,7 +55,7 @@ find_path_to_jackdrc(char *path_to_jackdrc)
// The above call should have given us the path to the user's home folder
char* pos;
char ch = user_jackdrc[strlen(user_jackdrc)-1];
char ch = user_jackdrc[strlen(user_jackdrc)-1];
if (('/' != ch) && ('\\' != ch))
strcat(user_jackdrc, "\\");
......@@ -94,24 +94,25 @@ find_path_to_jackdrc(char *path_to_jackdrc)
*/
#include <direct.h>
static int start_server_aux(const char* server_name)
{
FILE* fp = 0;
size_t pos = 0;
size_t result = 0;
int i = 0;
int good = 0;
int ret = 0;
char* command = 0;
char** argv = 0;
char* p;
char* back_slash;
char* forward_slash;
char arguments [256];
char buffer [MAX_PATH];
char filename [MAX_PATH];
char curr_wd [MAX_PATH];
char temp_wd [MAX_PATH];
FILE* fp = 0;
size_t pos = 0;
size_t result = 0;
int i = 0;
int good = 0;
int ret = 0;
char* command = 0;
char** argv = 0;
char* p;
char* back_slash;
char* forward_slash;
char arguments [256];
char buffer [MAX_PATH];
char filename [MAX_PATH];
char curr_wd [MAX_PATH];
char temp_wd [MAX_PATH];
curr_wd[0] = '\0';
if (find_path_to_jackdrc(filename))
......@@ -309,7 +310,7 @@ int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t*
}
return 0;
}
}
#endif // WIN32 && !__CYGWIN__
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment