Peer to peer connection

Hi,
I'm trying to make a program to transfer files between my pc and another 
that is behind a router. My side will act as master and the other just as a 
slave, serving what master asks without user interference.
I know that the easiest way is to run a idTCPserver at the slave side and a 
idTCPclient at master's side, but this needs to forward the used port at the 
router. I want to keep out of this.
So I try the reverse way. A idTCPclient at slave side and  idTCPserver at my 
side as master (in my side I can forward ports).
Starting the slave it connects to master-server. After this I try two 
variants.
1. Inside a timer.onTimer, TCPclient sends a message to server which 
responses with a command that the slave must do or just a acknowledgement if 
nothing needs. If there is a command the slave sends back the result, reads 
the answer and enables the timer for the next steps.
The code is like this.
procedure TFormSlave.Timer1Timer(Sender: TObject);
begin
    application.ProcessMessages;
    if not IdTCPClient1.Connected then exit;
    timer1.Enabled := FALSE;
    IdTCPClient1.IOHandler.WriteLn(aAskMaster);
    cmd := IdTCPClient1.IOHandler.readLn; // server sends a writeln(aString) 
and cmd receives this string
   // if cmd  = .... then doThis else
    // if cmd  = .... then doThat ;
    timer1.Enabled := TRUE; // in this point raises an exception "access 
violation at address 00000. read of address 00000"
end;

2. The other thought is :  after the connection, when master needs 
something, the idTCPserver sends messages to idTCPclient which sends back 
the answer. Like an inversion of roles. That would be more convenient but I 
can't manage it.

Is there a better approach or improvement of the above , please ?
thanks in advance
0
Papas
1/1/2012 6:32:57 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

0 Replies
916 Views

Similar Articles

[PageSpeed] 6

Reply:

Similar Artilces:

peer to peer
Hi guys I don't have to reset my home peer to peer often so I have totally forgotten how to do it. I am running win98se with all the updates, thin Ethernet cable Ethernet cards in each machine. The computer tells me that the ports, irq, and mem address match between hardware and software, the workgroup names are the same. I can see the one computer name in nhood on each machine but not both names on each machine. I uninstalled ZAF and moved the IE6.0 beta INTRANET security to low. This was working yesterday I installed a new copy of Win98se on my wife's machine which hadn...

Peer to Peer
Hi, I am studying a new Peer2Peer project and I have some concerns that speed limit cannot be done. I mean. The software can show the download (or upload) is using n% ( n<30) of your bandwidth but in fact it's using all of it. If I get the project, I will use Delphi + Indy. But first I would like to know from you if you can control your bandwidth through a software? TIA, Clément Hi, You generally cant control the peak bandwidth use (unless you have the intention to hack the network card in use). You can however control the bandwidth use over time. You do th...

PEER-TO-PEER
Howdy Security minded people!!! Iwas wondering , How much Peer -to -peer file sharing can you NOT do with a GOOD firewall like ZONE alarm, TpF , and SYgate.????????? Does not a firewall BLOCK OFF the PORT 139 NETBIOS feature that is SO intrinsic to FILESHARING ?? ,ala GNUTELLA , GROKSTER ,IMESH ,KAZZA ????????????? sstu wrote: > Howdy Security minded people!!! Iwas wondering , How much Peer > -to -peer file sharing can you NOT do with a GOOD firewall like ZONE > alarm, TpF , and SYgate.????????? Does not a firewall BLOCK OFF the > PORT 139 NETBIOS feat...

Peer To Peer Connection Problem
Our customer has a peer to peer Win '95 Sybase SQL Anywhere 5.5.00 on a Compaq Presario and we are trying to get the client connected to the server machine. The database engine is running and we have verified that it is accepting requests. We are able to browse the server through network neighborhood on the client so the connection to the server is fine. To get the client to connect to the server we have to bring down the DB engine and then bring it back up and the connection goes fine. The problem is that if the DB is not connected to from the client within approximately 30 min...

Connection peer to peer Firebird
Delphi 2010 dbExpress SqLConnection I need to connect a database (Firebird) on a peer to peer It 'the first time that use dbExpress for networked applications Driver / Database I set; \\192.168.1.1\Z:\SIDDAT\SIDDAT.FDB error message : "unavailable database" I have little experience with dbExpress if someone can help me connetere network in the Db .. Thanks PS: by the way the parameter "\\ 192.168.1.1 \ Z: \ SIDDAT \ SIDDAT.FDB"        should be read from a table > {quote:title=Maurizio Ceglar wro...

Peer 2 Peer
Hi, is there any quick guide about using P2P functionality in 3.8?, i've been using unison between 2 hosts and worked well so far. Now I need to sync 4 machines with the same data and I guess iFolder would do a better job. Regards, -- ciriarte ------------------------------------------------------------------------ ciriarte, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Vis...

Peer to peer with XP
I'm back to my never ending network server dilemma... I last left off building a new server computer running W2Kpro and Metadot portal intranet server. It has been working well but not in active use, it's sitting on my bench running everything and backing itself up every night. Problem with Metadot is a) I cannot get direct file access to the HD. b) It's way more than we need. We basically just want to have access to shared MS access, word and excel docs on the server and be able to open them on any local PC. In the Win9x days this is what worked, but since the addi...

Peer to Peer Option
--____ADXKZADLVECJQHAJDWKJ____ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; modification-date="Tue, 20 Feb 2006 10:29:28 +0000" Hi, Does anyone know how to setup the iFolder 3.2 peer to peer option? on the = iFolder website (www.ifolder.com) it says it is contained in the source = downloads. Can anyone help me? Thanks in advance. Steve. --____ADXKZADLVECJQHAJDWKJ____ Content-Type: multipart/related; boundary="____SBDTGINQINGHZHNMBGVL____" --____SBDTGINQINGHZHNMBGVL____ ...

Peer to Peer Issues
I have a small network operating behind a NAT router, OSs consist of XP home and Ubuntu Linux. On my NAT router I have tended to block all ports outbound and open up as required. In the UK many TV networks operate a Peer to Peer system to allow viewers to catch up on TV programs after the initial broadcast. What are the main security issues with this, I understand P2P as effectively allowing anyone access to my PC but assume this is Read Only and only a specific directory. To date I have tended to use the streaming service but quality is less than obtaining the entire p...

peer to peer programming
Hi, Does anyone know where I could find information about creating peer to peer applications in perl? (Like messengers that don't require a base server...) If it is possible to do it in perl, please tell me where I can find more about it if you know. Thank you. Octavian On Wed, 2008-08-13 at 20:45 +0300, Octavian Rasnita wrote: > Hi, > > Does anyone know where I could find information about creating peer to peer > applications in perl? > (Like messengers that don't require a base server...) > > If it is possible to do it in perl, plea...

Ghost peer to peer
Sometimes we ghost image 1 machine from another (peer to peer). If I do this with ZCM, what must I do to the freshly imaged machine to have registration, etc. work correctly? -- willmw ------------------------------------------------------------------------ willmw, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Visit http://support.novell.com and search the knowledgebase and/or che...

Peer to peer applications
Am facing a problem in developing peer to peer appln. first of all a machine has two ips(one private visible in intranet like 192.168.0.121 and second public ip visible in internet 10.2.2.3).now i need to connect to a peer located at remote place with the same criteria(two ips).The problem is i cnt go through the public ip to internal ip.On reading some articles on net i came to know the technique used to connect through public ip to private ip is termed as "HOLE PUNCHING"/"PORT FORWARDING".can some one help me on this issue? r is there any alternative other than this.I have to do it progra...

Hamachi
Having briefly read about the new Hamachi VPN system I am of the understanding that to initially make the connection I have to log on to the Hamaci server to get the IP addresses. Would this not only be necessary for dynamic IP addresses. Geoff Lane Geoff Lane wrote: > Having briefly read about the new Hamachi VPN system I am of the > understanding that to initially make the connection I have to log on > to the Hamaci server to get the IP addresses. > > Would this not only be necessary for dynamic IP addresses. > > Geoff Lane > I'm not sure...

peer to peer with mynew xp
I got a new notebook, with my first use of xp. Our small lan is all w98se. When I plug in the notebook and set up an ip address, I can ping all the computers both ways but can't do the file share. from what I read xp doesn't use netbeui, but does install netbios which is used for the lan file and machine access. However, a few of the articles I read on this say xp has to install the netBEUI to work with win98 machines, yet MS discontinues support or recommendation of using thie proto. I see xp does supply the netbeui as an add on but since it is not part of the sta...

Web resources about - Peer to peer connection - embarcadero.delphi.winsock

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
If you send more email, you might make more money. Then again, you might destroy your reputation and revenue stream. Here's how to know what ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

MOTHER’S DAY: Facebook Examines Connections Between Moms, Kids
With Mother’s Day on the calendar this coming Sunday, Facebook examined the relationships between mothers and their children on the social network, ...

Kings Cross identities arrested in connection with murder
Two Kings Cross identities&nbsp;have been arrested in connection with the murder of a man at Sydney hotel.

Faith: Spirits lift in connection with home
We need to more adequately understand the spirituality of our unique place on earth.

Governor declares state of emergency in connection with California methane leak
... of Emergency Services) On Wednesday evening, California Governor Jerry Brown declared a state of emergency in Los Angeles County in connection ...

Tons Of Methane Are Spewing Out Of California, And There’s A Connection To The Governor
The out of control leak has forced thousands of residents to flee their homes. Gov. Brown's sister is a paid board member at the company that ...

Report: Man arrested in connection with Ashley Olsen's murder
Italian media agency reports that a non-EU male has been arrested in the murder of the 35-year-old American

Toyota and Kymeta rely on satellites to power this Mirai's data connection
They're hoping to achieve gigabit wireless speeds within the next few years.

Resources last updated: 1/17/2016 10:09:40 AM