Code: Select all
#include "stdafx.h"
#include <iostream>
#include "SockStream.h"
using namespace std;
int main( int argc, char** argv )
{
const char* address = "localhost:5051";
if( argc > 1 )
address = argv[ 1 ];
receiving_udpsocket socket( address );
sockstream connection( socket );
string line;
// Print each line of BCI2000 input to stdout.
while( getline( connection, line ) )
//cout << line << endl;
return 0;
}
I have the BCI2000 running, but when I run this code I get the following error:
Code: Select all
'ReadOutput.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'ReadOutput.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'ReadOutput.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'ReadOutput.exe': Loaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL'
First-chance exception at 0x75a1c42d in ReadOutput.exe: Microsoft C++ exception: std::runtime_error at memory location 0x0040f4f4..
Code: Select all
streamsize
streambuf::read( char* p, streamsize n )
{
if( n < 1 )
return 0;
streamsize r = on_read( p, n );
if( r < 0 )
throw std::runtime_error( "Read failure" );
m_read += r;
return r;
}