Page 1 of 2
Differences in interpretation of native PB network code.
Posted: Tue Oct 16, 2012 1:09 am
by RichAlgeni
http://www.purebasic.fr/english/viewtop ... 16#p393516
In the above thread, Fred makes the statement:
ReceiveNetworkData() should be called only after a #PB_NetworkEvent_Data, every other use is wrong.
I believe that this statement is incorrect, as it precludes the most efficient use of sockets in threads, and it also does not allow for persistent socket connections. I may not have as much experience as others with PureBasic, but I have 20 years experience with sockets. If we are going to convince Fred that he was mistaken in his analysis of the prior thread, I will need others to express their opinion on the subject.
Rich
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 9:06 am
by MachineCode
It's not incorrect, because that's the way data has been made to work in PureBasic. It may not be "correct", but it's the way it's been implemented in PureBasic, so you need to follow what the instructions say to use it the way PureBasic expects.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 10:35 am
by Fred
It's the way it was designed. If you need more control, you can use the socket API, it's not that complicated (if you have 20 years of XP in sockets, it shouldn't be a problem)
BTW: putting my name in a thread topic isn't correct and won't change anything.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 5:41 pm
by Primoz128
Are you skeptic ? Ask Fred ^^.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 5:55 pm
by RichAlgeni
Please don't talk to me as if I were born last night. Yes, you do a very good job, and yes, I am thankful, as I've demonstrated by my multiple donations. But don't think for a moment that I, and others are mindless lemmings, marching to your beat. Yes, I have 20 years experience in sockets, and yes, it's not a problem for me (as I have demonstrated by posting socket code with the windows API.)
That experience you so blithely dismiss was something that I thought might be useful to you and the product. Apparently I was wrong in thinking that my suggestions, if considered, and made native, might help those who work on other platforms. My apologies for thinking that you might not know absolutely everything.
One more thing, don't presume to know what I was thinking when I put your name in the thread topic. My only goal was to make sure you saw it.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:03 pm
by Primoz128
RichAlgeni wrote:Please don't talk to me as if I were born last night. Yes, you do a very good job, and yes, I am thankful, as I've demonstrated by my multiple donations. But don't think for a moment that I, and others are mindless lemmings, marching to your beat. Yes, I have 20 years experience in sockets, and yes, it's not a problem for me (as I have demonstrated by posting socket code with the windows API.)
That experience you so blithely dismiss was something that I thought might be useful to you and the product. Apparently I was wrong in thinking that my suggestions, if considered, and made native, might help those who work on other platforms. My apologies for thinking that you might not know absolutely everything.
One more thing, don't presume to know what I was thinking when I put your name in the thread topic. My only goal was to make sure you saw it.
Third to half of the post is braging of your skill, please calm your head.
And as Fred said, you allways can use Win Api instead...
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:08 pm
by RichAlgeni
Third to half of the post is braging of your skill, please calm your head.
So Priimoz128, you would only accept suggestions from the inexperienced? My bad.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:10 pm
by Primoz128
You don't get it do you ?
It's USE the way PB was made or use Win Api, or gtfo raging or crying.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:14 pm
by RichAlgeni
You're about as helpful as tits on a bull Primoz.
What is the purpose of the forums? This might be over your head.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:18 pm
by Primoz128
Your a lost case, not gona bother anymore.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:20 pm
by RichAlgeni
Promise????

Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 6:56 pm
by RichAlgeni
Look Primoz128, I apologize to you for being a dick, it's something that comes to easy to me. It's just that I don't appreciate being patronized about something I feel strongly about. I don't know nor do I use 2D or 3D, so I don't post about it. I do know sockets, I have experience in using them, and thought this experience could be helpful to others, and Purebasic.
I can understand if someone says 'that's just not the direction we are going in at this time', or 'we have other priorities right now.'
MachineCode said:
It's not incorrect, because that's the way data has been made to work in PureBasic
This whole thing started with
ReceiveNetworkData() returns -1, when it should be 0.
If that's not wrong, what is?
I don't have a dog in this fight anymore, as I don't make the decisions on what happens with PB. I felt strongly about this subject, and therefore I had to speak up. Others have a differing opinion. I can work around the issue with no problems using windows code. I consider the issue settled.
Re: Fred, I believe you are mistaken on this...
Posted: Tue Oct 16, 2012 7:09 pm
by Primoz128
Receiving -1 might just be easier to some people... positive (received) = 1; negative (not received) = -1, 0 might seem weird to some... it's Pure BASIC(for begginers...)
Re: Fred, I believe you are mistaken on this...
Posted: Wed Oct 17, 2012 10:55 pm
by BorisTheOld
Primoz128 wrote:Receiving -1 might just be easier to some people... positive (received) = 1; negative (not received) = -1, 0 might seem weird to some... it's Pure BASIC(for begginers...)
Zero seems perfectly normal to me, since in most languages zero means false, and anything else means true.
Returning -1 to mean false is what's confusing, but unfortunately that's the way PB works.
Re: Oh mighty and powerful Oz, I believe you are mistaken on
Posted: Wed Oct 17, 2012 11:46 pm
by RichAlgeni
The problem Boris is that the socket is still connected, nothing is received, yet -1 is returned.
But, 'he who shall not be named in thread titles' has ruled, it is what it is.