Re: [fpc-pascal] why connect is "deprecated"

2013-04-18 Thread Tomas Hajny
On Thu, April 18, 2013 13:46, Marco van de Voort wrote: > In our previous episode, Jonas Maebe said: . . >> > That would also make it possible to directly map socketerror to >> > getlastresult/fpgeterrno, instead of caching it in another threadvar. >> >> IIRC the problem with removing socketerror

Re: [fpc-pascal] why connect is "deprecated"

2013-04-18 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: > > sb > > wants to support and modernize them, I have no problem with that. > > But that > > hasn't happened since 2005-2007 or so. The modernize bit above also refers to the changes done during the 2.0 RTL update, the functions still have a 1.0.x sig

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Zaher Dirkey
You can get some hints from minilib https://sourceforge.net/p/minilib "socket" directory On Tue, Apr 16, 2013 at 2:53 PM, Xiangrong Fang wrote: > using the socket like read/write file is very convenient. This is the > first time I use fpc to write socket program, it is much easier than I used

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Xiangrong Fang
using the socket like read/write file is very convenient. This is the first time I use fpc to write socket program, it is much easier than I used Indy or ICS in Delphi several years ago. I hope to "modernize" or make it more stable, instead of deprecate it. Of course deprecate Connect and use fp

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Jonas Maebe
On 16 Apr 2013, at 12:13, Marco van de Voort wrote: In our previous episode, Jonas Maebe said: As far as I can see, all errors are returned via inoutres/IOResult in the same way as happens with disk-based IO. Yes. An attempt is made to map some of the errors to I/O. Anyway, if sb wants to

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: > >> Function Connect(Sock:longint;const addr:TInetSockAddr;var > >> SockIn,SockOut:text):Boolean; deprecated; > > > > It was deprecated for two reasons: > > > > 1. the format, returntype and parameter typing is at 1.0.x level and > > was > > never updat

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Jonas Maebe
On 16 Apr 2013, at 11:53, Marco van de Voort wrote: In our previous episode, Xiangrong Fang said: I am trying to write a tcp client (redis) in free pascal, and found this function marked as deprecated: Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:text):Boolean;

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Marco van de Voort
In our previous episode, Victor Campillo said: > > I think that Connect was replaced by fpconnect that is more cross > platform, so you should use fpconnect instead of Connect. > The same happens with the other sockets functions like Accept, Bind, > etc. You should use fpaccept, fpbind, etc. >

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Xiangrong Fang
Yes, I read the source code and found that fpconnect + socktotext = connect, but just don't know why combining them together is a bad idea :-) thanks 2013/4/16 Victor Campillo > On 16/04/13 11:12, Xiangrong Fang wrote: > > Hi All, > > I am trying to write a tcp client (redis) in free pascal,

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Marco van de Voort
In our previous episode, Xiangrong Fang said: > I am trying to write a tcp client (redis) in free pascal, and found this > function marked as deprecated: > > Function Connect(Sock:longint;const addr:TInetSockAddr;var > SockIn,SockOut:text):Boolean; deprecated; It was deprecated for two reasons:

Re: [fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Victor Campillo
On 16/04/13 11:12, Xiangrong Fang wrote: Hi All, I am trying to write a tcp client (redis) in free pascal, and found this function marked as deprecated: Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:text):Boolean; deprecated; My question is, why it is deprecated

[fpc-pascal] why connect is "deprecated"

2013-04-16 Thread Xiangrong Fang
Hi All, I am trying to write a tcp client (redis) in free pascal, and found this function marked as deprecated: Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:text):Boolean; deprecated; My question is, why it is deprecated, or, what is the replacement for this function