Differences in interpretation of native PB network code.

Everything else that doesn't fall into one of the other PB categories.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Differences in interpretation of native PB network code.

Post 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
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Fred, I believe you are mistaken on this...

Post 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.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Fred, I believe you are mistaken on this...

Post by Primoz128 »

Are you skeptic ? Ask Fred ^^.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Fred, I believe you are mistaken on this...

Post 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...
Last edited by Primoz128 on Tue Oct 16, 2012 6:09 pm, edited 1 time in total.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Fred, I believe you are mistaken on this...

Post by Primoz128 »

Your a lost case, not gona bother anymore.
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Fred, I believe you are mistaken on this...

Post by RichAlgeni »

Promise???? :lol:
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Fred, I believe you are mistaken on this...

Post 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.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Fred, I believe you are mistaken on this...

Post 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...)
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: Fred, I believe you are mistaken on this...

Post 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.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Oh mighty and powerful Oz, I believe you are mistaken on

Post 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.
Post Reply