Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Help needed with link errors (serversocket)
Help needed with link errors (serversocket) [message #48510] Tue, 11 July 2017 23:46 Go to previous message
imos is currently offline  imos
Messages: 17
Registered: July 2017
Promising Member
Hi
I am trying to find a dev env to develop a socket oriented deamon (non-blocking) using high level approachs (for sockets and data structures) and I decided to give a try to U++.

I am trying to put to work the ServerSocket example but I have link errors that I can not solve alone. Here the code:

#include <Core/Core.h>
#include <Web/Web.h>

using namespace Upp;

Socket accept_socket, data_socket;
int port = 2020;


CONSOLE_APP_MAIN
{
	if(!ServerSocket(accept_socket, port)) // Listen for connections using _accept_socket;
	{
	    throw Exc("Couldn't bind socket on the local port.");
	}
	// You can do this in a loop to accept many connections:
	if( accept_socket.IsOpen() )
	{
	    dword ip_addr;
	    // Hand off successful connection to _data_socket
	    if( !accept_socket.IsError() && accept_socket.Accept(data_socket, &ip_addr) )
	    {
	        //Cout() << "Connection from " << FormatIP(m_ipaddr) << "\n";
	        Cout() << "Connection from " << "\n";
	        // Read from the socket until it is closed, has an error, or you see an end-of-file marker
	        // (EOF optional and application-specific)
	        while(data_socket.IsOpen() && !data_socket.IsEof() && !data_socket.IsError())
	        {
	            Cout() << data_socket.Read();
	        
}
}
Cout() << "\n";
}
}

I also added the Web package to the project but I get these link errors:


...Web/html.cpp (347): error: ambiguous overload for 'operator+' (operand types are 'Upp::HtmlTag' and 'Upp::Htmls')


.../Web/auth.cpp (219): error: ambiguous overload for 'operator+' (operand types are 'Upp::Htmls' and 'Upp::HtmlTag')

Etc.


Thanks a lot

Imos
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Choosing the best way to go full UNICODE
Next Topic: SFTP or full SSH2 support for U++?
Goto Forum:
  


Current Time: Mon Apr 29 13:20:28 CEST 2024

Total time taken to generate the page: 0.02617 seconds