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 » U++ Library support » U++ Core » Problem with websocket connect method
Re: Problem with websocket connect method [message #49003 is a reply to message #48998] Thu, 23 November 2017 21:58 Go to previous messageGo to previous message
shutalker is currently offline  shutalker
Messages: 15
Registered: November 2017
Location: Moscow
Promising Member
It seems I've got another problem with nonblocking Connect method. When I'm trying to connect in nonblocking mode from a simple client to a simple server my app generates error message after I call Do():
ws.NonBlocking().Connect("ws://127.0.0.1:8888");
ws.Do();


In nonblocking mode Connect() just sets opcode variable in DNS state and makes no operations until Do() is called:
if(socket->IsBlocking())
    ...
else
    opcode = DNS;

return true;


In Do0 there is if-statement listed below:
if(socket->IsEof() && !(close_sent || close_received))
    Error("Socket has been closed unexpectedly");


And in the IsEof method there is checkup for socket's descriptor state:
bool TcpSocket::IsEof() const
{
    return is_eof && ptr == end || IsAbort() || !IsOpen() || IsError();
}


As far as I can understand IsOpen returns true since the socket was not opened. So I can't process DNS state and make connection in nonblocking mode.

I used upp sources from github: 993904e
Compiler: GCC 5.4.1

[Updated on: Thu, 23 November 2017 22:01]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bug with FindMatch(const Range& r, const C& match, int from = 0)
Next Topic: Vector<Vector<double>>
Goto Forum:
  


Current Time: Sun Apr 28 20:21:05 CEST 2024

Total time taken to generate the page: 0.04133 seconds