[twsocket] ftp to Table

2005-10-04 Thread Werner
Hi

I like to use ics ftp to transfer the contents direct to a table and not save 
it first to disk
Could this be possible?
Now I'm saving to contents to a file on disk, then read the file and save the 
contents to the table, wich is time comsuming.

Now:

1.open the ftp
2. read one or more files from ftp
3. save one or more files to disk
4. read file from disk and save to table
5. then close ftp

I like to

1.open the ftp
2. read file from ftp and save to table
3. then close ftp

If not possible with ftp, can this be done with socket to access an ftp server
Would be great for an example

Thanks in advance for any response
Werner
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ftp to Table

2005-10-04 Thread Werner



  I like to use ics ftp to transfer the contents direct to a table and not
save it first to disk
  Could this be possible?
  Now I'm saving to contents to a file on disk, then read the file and
save the contents to the
 table, wich is time comsuming.
 
  Now:
 
  1.open the ftp
  2. read one or more files from ftp
  3. save one or more files to disk
  4. read file from disk and save to table
  5. then close ftp
 
  I like to
 
  1.open the ftp
  2. read file from ftp and save to table
  3. then close ftp
 
  If not possible with ftp, can this be done with socket to access an ftp
server
  Would be great for an example

 Not sure I understand the problem. Do you mean you want to save a big file
located on a FTP to a
 table locate in a database accessible from a client PC ? Do you mean you
want to avoid saving the
 file to a local file first and save to the table on the fly.

 On solution is to design a TSream derived class that when you write data
to it, data is written to
 your table. FTP component will then be able to use it with his LocalStream
property.


I have a small file located on a FTP
I want to read this file, line per line, and save this data direct to a
local table.
So I don't need to save this file first to disk, and read it again.

I took a look at the localSteam property, and tried this example.
The ms.Size give a number, but I can't get the stream into data?

var
ms:TStringStream;
data:string;
begin
ms:=TStringStream.Create(data);
try
FtpClient1.HostName:= HostNameEdit.Text;
FtpClient1.Port  := PortEdit.Text;
FtpClient1.UserName:= UserNameEdit.Text;
FtpClient1.PassWord:= PassWordEdit.Text;
FtpClient1.HostDirName := HostDirEdit.Text;
FtpClient1.HostFileName:= HostFileEdit.Text;
FtpClient1.LocalStream := ms;
FtpClient1.Binary  := True;
FtpClient1.Receive;
DisplayMemo.lines.Add('Memorystream '+IntToSTr(ms.Size));
DisplayMemo.Lines.Add(data);
finally
ms.Free;
end;
end;







 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] ftp to Table

2005-10-04 Thread Werner

Thanks

ms.Seek(0,0);
 DisplayMemo.Lines.Add(ms.DataString);

Works great. It looks like ms.Seek is quit important sometimes. In case of
using TMemoryStream its needed, TStringStream not all the time.

  ms:=TStringStream.Create(data);
When using TStringStream.Create('') it's the same, seems like the var 'data'
has no meaning here.

Thanks for your help
Werner



- Oorspronkelijk bericht - 
Van: Guillaume MAISON [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: dinsdag, oktober 04, 2005 11:57
Onderwerp: Re: [twsocket] ftp to Table


 
  I have a small file located on a FTP
  I want to read this file, line per line, and save this data direct to a
  local table.
  So I don't need to save this file first to disk, and read it again.
 
  I took a look at the localSteam property, and tried this example.
  The ms.Size give a number, but I can't get the stream into data?
 
  var
  ms:TStringStream;
  data:string;
  begin
  ms:=TStringStream.Create(data);
  try
  FtpClient1.HostName:= HostNameEdit.Text;
  FtpClient1.Port  := PortEdit.Text;
  FtpClient1.UserName:= UserNameEdit.Text;
  FtpClient1.PassWord:= PassWordEdit.Text;
  FtpClient1.HostDirName := HostDirEdit.Text;
  FtpClient1.HostFileName:= HostFileEdit.Text;
  FtpClient1.LocalStream := ms;
  FtpClient1.Binary  := True;
  FtpClient1.Receive;
  DisplayMemo.lines.Add('Memorystream '+IntToSTr(ms.Size));

  DisplayMemo.Lines.Add(data);
 You should replace this line by :

 ms.Seek(0,0);
 DisplayMemo.Lines.Add(ms.DataString);

  finally
  ms.Free;
  end;
  end;

 HTH,

 Best regards,

 -- 

 Guillaume MAISON - [EMAIL PROTECTED]
 83, Cours Victor Hugo
 47000 AGEN
 Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Socket server overhead

2005-10-08 Thread Werner
Hi,

I have an application that continueous (every 500ms) have contact with a 
machine by rs232. Main thread.
I want to send some information by socket when an external program ask this.
So this program must also listen as a server socket.

My question: 
when a server socket is in listening mode, does it take a lot of resources ?, 
would it be best to put this in a thread with low priority?, but if I do this, 
will the communication with the rs232 not take all the attention, so the thread 
with low priority will not work.

Any response on this would be great.
Thanks
Werner
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Socket one to one

2005-10-10 Thread Werner
Thanks,
I'll try this

- Oorspronkelijk bericht - 
Van: Wilfried Mestdagh [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: zaterdag, oktober 08, 2005 11:28
Onderwerp: Re: [twsocket] Socket one to one


 Hello Werner,
 
 You always need a listening socket to accept inbound connections. When a
 client connect you accept/dup the client to a data socket. Server stay
 listening. You can use a normal TWSocket as server and handle the
 creation of data sockets, but then you are just re-inventing
 TWSocketServer who does that for you. You can set MaxClients to 2 if
 needed.
 
 Note that I'm talking about TCP. If you use UDP then you can do listen /
 send / receive with only 1 socket. But ICP is reliable the other not.
 
 ---
 Rgds, Wilfried
 http://www.mestdagh.biz
 
 Saturday, October 8, 2005, 10:02, Werner wrote:
 
  Hi,
 
  Is it possible to have a socket connection from client to client ?
  Because I need only a 1 to 1 connection, I don't need a server
  socket who is able to have multiple clients comming in.
 
  Is there a specific whay to have 1 to 1 connection. ?
  Has it any advantages not using serverSocket and only 2
  clients-socket if this is possible
 
  Thanks 
  Werner
 
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 
 
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Socket one to one

2005-10-10 Thread Werner
Thanks,
I'll check this out

 
 At the server end just use a TWSocket instead of a TWSocketServer if you 
 only need one client.  Then it needs to listen:
 Socket.Listen;
 and when a connection comes in (SessionAvailable) you accept it:
 Socket.HSocket := Socket.Accept;
 Then the connection is established.
 
 Dan 
 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Socket - streams

2005-10-19 Thread Werner
Hi,

Does twSocket has a method to use streams
I want to recieve some data in a TStringStream

Now, I'm using CliSocket.ReceiveStr to recieve data and put this in a buffer 
until all data is read
I wonder if I can read all data in one piece by using streams?

Thanks for any suggestions
Werner
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Socket - TimeOut

2005-10-19 Thread Werner
Thank,

Thanks, I'll check the receive function

An other Q. about TimeOut
After connect to the server, I send a string 'SENDDATA'
In OnDataAvailable, i check for incoming data, but when no data arives, then
I want to close the connection.
Now I'm using a separate timer to check this.
Is there an other way to do this, so far I've red that after the connect,
onDataAvailable will fired direct, but is this when also when no data comes
in?

Thanks
Werner




- Oorspronkelijk bericht - 
Van: Wilfried Mestdagh [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: woensdag, oktober 19, 2005 10:46
Onderwerp: Re: [twsocket] Socket - streams


 Hello Werner,

 If you data has a terminating character then you can use lineMode. Then
 OnDataAvailable will only fire when thes character(s) are received and
 you have all your data at ones.

 If not it will arrive in many chunck, or datapackets can even be
 concatenatied. Thats nature of TCP.

  Now, I'm using CliSocket.ReceiveStr to recieve data and put this
  in a buffer until all data is read

 That is the right way to do if you dont have terminating characters.
 Better is to use Receive, then you save an extra copy to a string.

 ---
 Rgds, Wilfried [TeamICS]
 http://www.mestdagh.biz

 Wednesday, October 19, 2005, 10:18, Werner wrote:

  Hi,

  Does twSocket has a method to use streams
  I want to recieve some data in a TStringStream

  Now, I'm using CliSocket.ReceiveStr to recieve data and put this in a
buffer until all data is read
  I wonder if I can read all data in one piece by using streams?

  Thanks for any suggestions
  Werner

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Http - access table or tabular sheet

2006-03-22 Thread Werner
Hi to all,

Is it possible to make - access a table or tabular sheet to access an http site 
with ics components.
Http sheet should have a very simple list, and should hold about 200 records, 
it is not needed to show this site like a regular http sheet:
CurstNr  OrderNr
-
110
222
315

I would like to:
1. update this table
2. consult this table 

Thanks for any suggestions or reading material
Greetings
Werner

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Http - access table or tabular sheet

2006-03-22 Thread Werner
Hi Francois
So if I want to make only one simple modification, let's say one record, I
can do this with http get - modified - then post the page again ?
thx

- Oorspronkelijk bericht - 
Van: Francois Piette [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: woensdag, maart 22, 2006 10:22
Onderwerp: Re: [twsocket] Http - access table or tabular sheet


  Yes this data is on a web page, on my server provider.
  The thing is, that many users should be able to update and read this
data.
  So for example, CustNr 2, will update his ordernr to 25, then I need
from
  time to time to read his actual orderNr.
  So I like to create a dynamic site. I'm very new on this, and know only
how
  to read a fix http page.

 As far as a client component is concerned, reading a dynamic page is
exactly the same as reading a
 static page. At least when dynamic aspect is built at server side. Client
side dynamic is handled by
 JavaScript, ActiveX, JavaApplet and similar technologies. Those
technologies are beyond a HTTP
 component.

 Server side dynamic page (ASP, PHP, Delphi, JSP, CGI, ISAPI and many
others) make no difference for
 the client.

 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Http - access table or tabular sheet

2006-03-22 Thread Werner
all is very new to me...
I have x webspace with my service provider. I want to create 1 dynamic page
on it.
- can I put an ics Http Server on it? or do I need to create other stuff
first
- or do I need to create this Http Server on my computer, but then I need to
run it my computer all the time, so users can access it?
thx to enlight this


- Oorspronkelijk bericht - 
Van: Francois Piette [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: woensdag, maart 22, 2006 12:01
Onderwerp: Re: [twsocket] Http - access table or tabular sheet


  So if I want to make only one simple modification, let's say one record,
I
  can do this with http get - modified - then post the page again ?

 No, it doesn't work like that. You have to build something at server side
to handle you dynamic
 page. What kind of server do you have ? Are you willing to build it using
ICS HTTP server component
 ?

 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be



  thx
 
  - Oorspronkelijk bericht - 
  Van: Francois Piette [EMAIL PROTECTED]
  Aan: ICS support mailing twsocket@elists.org
  Verzonden: woensdag, maart 22, 2006 10:22
  Onderwerp: Re: [twsocket] Http - access table or tabular sheet
 
 
Yes this data is on a web page, on my server provider.
The thing is, that many users should be able to update and read this
  data.
So for example, CustNr 2, will update his ordernr to 25, then I need
  from
time to time to read his actual orderNr.
So I like to create a dynamic site. I'm very new on this, and know
only
  how
to read a fix http page.
  
   As far as a client component is concerned, reading a dynamic page is
  exactly the same as reading a
   static page. At least when dynamic aspect is built at server side.
Client
  side dynamic is handled by
   JavaScript, ActiveX, JavaApplet and similar technologies. Those
  technologies are beyond a HTTP
   component.
  
   Server side dynamic page (ASP, PHP, Delphi, JSP, CGI, ISAPI and many
  others) make no difference for
   the client.
  
   --
   Contribute to the SSL Effort. Visit
   http://www.overbyte.be/eng/ssl.html
   --
   [EMAIL PROTECTED]
   Author of ICS (Internet Component Suite, freeware)
   Author of MidWare (Multi-tier framework, freeware)
   http://www.overbyte.be
  
  
   -- 
   To unsubscribe or change your settings for TWSocket mailing list
   please goto http://www.elists.org/mailman/listinfo/twsocket
   Visit our website at http://www.overbyte.be
  
  
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Port number

2006-03-30 Thread Werner
Hi All,

Using WSocket and GetPeerPort. The client has for example port 2000
When recieving a package then close again, then recieving -close, etc I receive 
2001 then next package 2002, 2003, etc. as portNumber
The portnumber seems to increase all the time, and not giving me the exact 
PeerPort like the PeerAddr wich is correct.

GetPeerPort , PeerPort give me not the peerport from the client.
I have tested this in a local lan, maybe this would be the problem ?

Any idee how to get the actual portnumber from the client side, when the client 
is connected
Thanks for any suggestions
Greetings - Werner

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Port number

2006-03-31 Thread Werner
Thank Wilfried, thats explains a lot.

When the server listen to port 2500, and the socket port start increasing
from 2000. Do I get in trouble when it comes finaly to port 2489,2499..2500
the same port where the server is listening, or is this handled automaticaly
by the socket that the increasing port will never be the listening server
port ?
To explain more: my program get every 10 seconds an incoming client, get the
command, then close again. And I see the port increasing fast, what about a
limit ? can I reset the portnumber?, it's a black hole for me.

The client has port 2000. When the client change his port to 2001, is there
a way, when connecting to the server to retreive the clients actual port
address?. I must know this port because I need to contact this client back
on an other WSocket. Ofcourse it wil work fine if the client don't change
his port number.

Thanks a lot
Werner


- Oorspronkelijk bericht - 
Van: Wilfried Mestdagh [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: vrijdag, maart 31, 2006 10:11
Onderwerp: Re: [twsocket] Port number


 Hello Werner,

 It is the exact peer port. I try to explain:

 -- for a server --
 Server listens on a certain addr:port. Client connect to that port, but
 server should stay listening, so the listening port has to be kept free,
 so as fast as possible the socket is duped to another local port. This
 port increase after each connect because the OS hold it in time_wait

 -- for a client --
 Client connect to a certain addr:port. But local it is also bound to an
 addr and port. This is the peer port when it is called by the server
 end.

 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz

 Thursday, March 30, 2006, 20:58, Werner wrote:

  Hi All,

  Using WSocket and GetPeerPort. The client has for example port 2000
  When recieving a package then close again, then recieving -close,
  etc I receive 2001 then next package 2002, 2003, etc. as portNumber
  The portnumber seems to increase all the time, and not giving me
  the exact PeerPort like the PeerAddr wich is correct.

  GetPeerPort , PeerPort give me not the peerport from the client.
  I have tested this in a local lan, maybe this would be the problem ?

  Any idee how to get the actual portnumber from the client side, when the
client is connected
  Thanks for any suggestions
  Greetings - Werner


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Port number

2006-03-31 Thread Werner


On a second session, the server turns client, and client turns server:
client(ComputerA) port 2000 - connect server(ComputerB) at port 2500. Close
connection ( ComputerB knows the adress, and gets the clients actual port,
in someway)
then
client(ComputerB) port 2500 - connect server(ComputerA) at port 2000. Close
connection. (This works fine when the ComputerA has a fix port adress)

The things is, when a new client access the server at an ipaddress, this
server( wich will be a clientSocket at that moment) needs to know the actual
port number to connect the client back (wich will be a serverSocket at that
moment). On a later moment.
So each computer has a client and serverSocket running.




  The client has port 2000. When the client change his port to 2001, is
there
  a way, when connecting to the server to retreive the clients actual port
  address?. I must know this port because I need to contact this client
back
  on an other WSocket. Ofcourse it wil work fine if the client don't
change
  his port number.

 I dont understeand the question. Can you explain again please ? Do you
 mean with 'Client' the 'Datasocket' of the server where you are
 connected with ? If so then this socket is released when tcp session is
 closed, but please explain again, it is not clear to me what you wants.

 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz

 Friday, March 31, 2006, 10:46, Werner wrote:

  Thank Wilfried, thats explains a lot.

  When the server listen to port 2500, and the socket port start
increasing
  from 2000. Do I get in trouble when it comes finaly to port
2489,2499..2500
  the same port where the server is listening, or is this handled
automaticaly
  by the socket that the increasing port will never be the listening
server
  port ?
  To explain more: my program get every 10 seconds an incoming client, get
the
  command, then close again. And I see the port increasing fast, what
about a
  limit ? can I reset the portnumber?, it's a black hole for me.

  The client has port 2000. When the client change his port to 2001, is
there
  a way, when connecting to the server to retreive the clients actual port
  address?. I must know this port because I need to contact this client
back
  on an other WSocket. Ofcourse it wil work fine if the client don't
change
  his port number.

  Thanks a lot
  Werner


  - Oorspronkelijk bericht - 
  Van: Wilfried Mestdagh [EMAIL PROTECTED]
  Aan: ICS support mailing twsocket@elists.org
  Verzonden: vrijdag, maart 31, 2006 10:11
  Onderwerp: Re: [twsocket] Port number


  Hello Werner,
 
  It is the exact peer port. I try to explain:
 
  -- for a server --
  Server listens on a certain addr:port. Client connect to that port, but
  server should stay listening, so the listening port has to be kept
free,
  so as fast as possible the socket is duped to another local port. This
  port increase after each connect because the OS hold it in time_wait
 
  -- for a client --
  Client connect to a certain addr:port. But local it is also bound to an
  addr and port. This is the peer port when it is called by the server
  end.
 
  ---
  Rgds, Wilfried [TeamICS]
  http://www.overbyte.be/eng/overbyte/teamics.html
  http://www.mestdagh.biz
 
  Thursday, March 30, 2006, 20:58, Werner wrote:
 
   Hi All,
 
   Using WSocket and GetPeerPort. The client has for example port 2000
   When recieving a package then close again, then recieving -close,
   etc I receive 2001 then next package 2002, 2003, etc. as portNumber
   The portnumber seems to increase all the time, and not giving me
   the exact PeerPort like the PeerAddr wich is correct.
 
   GetPeerPort , PeerPort give me not the peerport from the client.
   I have tested this in a local lan, maybe this would be the problem ?
 
   Any idee how to get the actual portnumber from the client side, when
the
  client is connected
   Thanks for any suggestions
   Greetings - Werner
 
 
  -- 
  To unsubscribe or change your settings for TWSocket mailing list
  please goto http://www.elists.org/mailman/listinfo/twsocket
  Visit our website at http://www.overbyte.be
 
 


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Port number

2006-03-31 Thread Werner
Yes, Wildried
I had that in mind, but was hoping to get it from a function.
But knowing that I'm not running out of serverports, give me better dreams
Thanks a lot
Werner


- Oorspronkelijk bericht - 
Van: Wilfried Mestdagh [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: vrijdag, maart 31, 2006 12:41
Onderwerp: Re: [twsocket] Port number


 Hello Werner,

 You have to make a little protocol for that. B listens on a know
 IP:Port. A connect to B and tells B the port he will listen on in the
 protocol. Then later B can connect to A because he know the listening
 port by then.

 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz

 Friday, March 31, 2006, 11:47, Werner wrote:



  On a second session, the server turns client, and client turns server:
  client(ComputerA) port 2000 - connect server(ComputerB) at port 2500.
Close
  connection ( ComputerB knows the adress, and gets the clients actual
port,
  in someway)
  then
  client(ComputerB) port 2500 - connect server(ComputerA) at port 2000.
Close
  connection. (This works fine when the ComputerA has a fix port adress)

  The things is, when a new client access the server at an ipaddress, this
  server( wich will be a clientSocket at that moment) needs to know the
actual
  port number to connect the client back (wich will be a serverSocket at
that
  moment). On a later moment.
  So each computer has a client and serverSocket running.



 
   The client has port 2000. When the client change his port to 2001, is
  there
   a way, when connecting to the server to retreive the clients actual
port
   address?. I must know this port because I need to contact this client
  back
   on an other WSocket. Ofcourse it wil work fine if the client don't
  change
   his port number.
 
  I dont understeand the question. Can you explain again please ? Do you
  mean with 'Client' the 'Datasocket' of the server where you are
  connected with ? If so then this socket is released when tcp session is
  closed, but please explain again, it is not clear to me what you wants.
 
  ---
  Rgds, Wilfried [TeamICS]
  http://www.overbyte.be/eng/overbyte/teamics.html
  http://www.mestdagh.biz
 
  Friday, March 31, 2006, 10:46, Werner wrote:
 
   Thank Wilfried, thats explains a lot.
 
   When the server listen to port 2500, and the socket port start
  increasing
   from 2000. Do I get in trouble when it comes finaly to port
  2489,2499..2500
   the same port where the server is listening, or is this handled
  automaticaly
   by the socket that the increasing port will never be the listening
  server
   port ?
   To explain more: my program get every 10 seconds an incoming client,
get
  the
   command, then close again. And I see the port increasing fast, what
  about a
   limit ? can I reset the portnumber?, it's a black hole for me.
 
   The client has port 2000. When the client change his port to 2001, is
  there
   a way, when connecting to the server to retreive the clients actual
port
   address?. I must know this port because I need to contact this client
  back
   on an other WSocket. Ofcourse it wil work fine if the client don't
  change
   his port number.
 
   Thanks a lot
   Werner
 
 
   - Oorspronkelijk bericht - 
   Van: Wilfried Mestdagh [EMAIL PROTECTED]
   Aan: ICS support mailing twsocket@elists.org
   Verzonden: vrijdag, maart 31, 2006 10:11
   Onderwerp: Re: [twsocket] Port number
 
 
   Hello Werner,
  
   It is the exact peer port. I try to explain:
  
   -- for a server --
   Server listens on a certain addr:port. Client connect to that port,
but
   server should stay listening, so the listening port has to be kept
  free,
   so as fast as possible the socket is duped to another local port.
This
   port increase after each connect because the OS hold it in time_wait
  
   -- for a client --
   Client connect to a certain addr:port. But local it is also bound to
an
   addr and port. This is the peer port when it is called by the server
   end.
  
   ---
   Rgds, Wilfried [TeamICS]
   http://www.overbyte.be/eng/overbyte/teamics.html
   http://www.mestdagh.biz
  
   Thursday, March 30, 2006, 20:58, Werner wrote:
  
Hi All,
  
Using WSocket and GetPeerPort. The client has for example port
2000
When recieving a package then close again, then recieving -close,
etc I receive 2001 then next package 2002, 2003, etc. as
portNumber
The portnumber seems to increase all the time, and not giving me
the exact PeerPort like the PeerAddr wich is correct.
  
GetPeerPort , PeerPort give me not the peerport from the client.
I have tested this in a local lan, maybe this would be the problem
?
  
Any idee how to get the actual portnumber from the client side,
when
  the
   client is connected
Thanks for any suggestions
Greetings - Werner
  
  
   -- 
   To unsubscribe or change your settings for TWSocket mailing list
   please goto http

Re: [twsocket] Disconnect

2006-05-05 Thread Werner
I had something simular.
Let the Client or Server close connection.
Maybe try not to close client connection, and let server close the
connection when done.

- Oorspronkelijk bericht - 
Van: Abdullah AlQasim [EMAIL PROTECTED]
Aan: twsocket@elists.org
Verzonden: donderdag, mei 04, 2006 14:46
Onderwerp: [twsocket] Disconnect


 Hello All,

 I am newbie with TWSocket  I have some critical problem with my
 project :

 My client disconnected with out any reasons some time form Dial-up and
 some times form my LAN  Server side was built with Java and I am
 using TWSocket with our protocol for getting data  My client is
 working fine parsing data and show it to grids.

 How can I be sure that my client doest not have a problem ... or ether
 this problem in Server side?

 Best Regards.


 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] TWSocket - send bytes - strange chars

2006-05-23 Thread Werner
Hi everyone,

I have a spooky situation.
I send a file.txt. This file contans some default chars as any file can have.
This file is sended with the proc below to a java application.
This java application will block reading until it has read all chars.
Now the problem is, that the java will get some stack errors, only when certain 
chars are sended in this file.txt
( and i realy don't know wich chars, but a test, leaving some chars out of the 
file, point in that direction, the size is not imported) 
I know this looks more like a java problem, but maybe somebody has encountered 
something simular.
So my question is : are their any chars or combination, that could be sensitive 
? This question is as wierd then the problem I have :).

Thanks for any idees
Greetings
Werner


procedure TMainForm.SendFile(sCmd,sFile:string);
var Fs: TFileStream;
Buffer: array[0..1023] of byte;
iCount: Integer;
begin

  Fs:=TFileStream.Create(sFile, fmOpenRead or fmShareDenyNone);
  try
{ send size file }
CliSocket.SendStr(IntToStr(Fs.Size)+#13#10);
{ send file }
repeat
  iCount:=Fs.Read(Buffer,sizeof(Buffer));
  if iCount  0 then
CliSocket.Send(@Buffer,iCount);
until iCount = 0;
{ flush socket }
CliSocket.Flush;
  finally
Fs.Free;
  end;
end;
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket - send bytes - strange chars

2006-05-24 Thread Werner
Thanks Wilfried to point me on this possibility, hoped this would be it.
I tried only sending bytes  31 and  127 but it remains the same.

Rgds,
Werner


- Oorspronkelijk bericht - 
Van: Wilfried Mestdagh [EMAIL PROTECTED]
Aan: ICS support mailing twsocket@elists.org
Verzonden: woensdag, mei 24, 2006 09:25
Onderwerp: Re: [twsocket] TWSocket - send bytes - strange chars


 Hello Werner,

 I'm pretty sure this is a Java problem. Something to do with the 16 bit
 char conversion. If you try text with char = 127 then do you have same
 problem too ?

 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz

 Tuesday, May 23, 2006, 21:54, Werner wrote:

  Hi everyone,

  I have a spooky situation.
  I send a file.txt. This file contans some default chars as any file can
have.
  This file is sended with the proc below to a java application.
  This java application will block reading until it has read all chars.
  Now the problem is, that the java will get some stack errors, only
  when certain chars are sended in this file.txt
  ( and i realy don't know wich chars, but a test, leaving some chars
  out of the file, point in that direction, the size is not imported)
  I know this looks more like a java problem, but maybe somebody has
encountered something simular.
  So my question is : are their any chars or combination, that could
  be sensitive ? This question is as wierd then the problem I have :).

  Thanks for any idees
  Greetings
  Werner


  procedure TMainForm.SendFile(sCmd,sFile:string);
  var Fs: TFileStream;
  Buffer: array[0..1023] of byte;
  iCount: Integer;
  begin

Fs:=TFileStream.Create(sFile, fmOpenRead or fmShareDenyNone);
try
  { send size file }
  CliSocket.SendStr(IntToStr(Fs.Size)+#13#10);
  { send file }
  repeat
iCount:=Fs.Read(Buffer,sizeof(Buffer));
if iCount  0 then
  CliSocket.Send(@Buffer,iCount);
  until iCount = 0;
  { flush socket }
  CliSocket.Flush;
finally
  Fs.Free;
end;
  end;

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] ICS - SMS - How to do

2006-05-24 Thread Werner
Hi,

Can anyone point me in the direction how I could send a sms by using ICS
components
1. Sending by modem
2. Sending by internet - prefered.

When sending by internet, do I need a kind of provider who send the sms's,
if so, wich one is best to use.
Please some example codes.

Thanks for all
Rgds,
Werner

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be