Home » U++ Library support » U++ MT-multithreading and servers » non-blocking socket.Write("test string") crash on linux [BUG?]
non-blocking socket.Write("test string") crash on linux [BUG?] [message #11116] |
Mon, 20 August 2007 20:45  |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
I haven't dived deep into sockets but just trying to help lectus on the other thread found that with non-blocking
socket.Write("test string");
crashes my program at /Web/socket.cpp ~line 290
int Socket::Data::Write(const void *buf, int amount)
{
RLOG("Socket::Data::Write: stil alive. amount= " << socket); //aris002
int res = send(socket, (const char *)buf, amount, 0); //DIES HERE!!!
RLOG("Socket::Data::Write: DEAD alive???. amount= " << amount); //aris002
if(res == 0 || res < 0 && GetLastError() != IS_BLOCKED)
SetSockError("send");
return res;
}
Is this a bug in upp or in my knowledge?
[Updated on: Mon, 20 August 2007 20:47] Report message to a moderator
|
|
|
|
|
Re: non-blocking socket.Write("test string") crash on linux [BUG?] [message #17918 is a reply to message #11133] |
Tue, 02 September 2008 22:48  |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Is there an example please for how all this is meant to work? I notice that P2Psocket is very incomplete. A simple example showing a client and a server exchanging text strings after the user types something in the client app and presses "send" would be great.
If I figure it out in the meantime I'll post it myself.
Nick
EDIT: No worries, I found \Web\TServ\tserv.cpp - everything a person needs to know about writing a simple socket set is there
[Updated on: Wed, 03 September 2008 00:33] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed May 14 04:56:19 CEST 2025
Total time taken to generate the page: 0.00530 seconds
|