I don't understand why sending messages over a socket is so hard. It seems
the code should be pretty straightforward: specify which machine you want to
send a message to, on which port, and send it. It should get there. However,
I've had problems with ICS, Indy, and am now trying Synapse. This is my
code:

Machine1 (client/sender):

procedure TForm15.Button1Click(Sender: TObject);
var
  sock: TTCPBlockSocket;
  s: string;
begin
  sock:= ttcpblocksocket.Create;
  try
    sock.ConvertLineEnd := True;
    { The IPAddress has been changed to protect the paranoid }
    sock.Connect('10.344.4.32','1144');
    sock.SendString('Sit on a potato pan Otis'+crlf);
  finally
    sock.Free;
  end;
end;

Machine 2 (server/listener):

procedure TIWUserSession.tmrTimer(Sender: TObject);
var
  sock: TTCPBlockSocket;
  s: String;
begin
  tmr.Enabled := False;
  sock := TTCPBlockSocket.Create;
  try
    sock.Bind('10.344.4.18', '1144');
    sock.Listen;
    s := sock.RecvString(30000);
  finally
    sock.Free;
    tmr.Enabled := True;
  end;
end;

Using Wireshark, I can see that the machines are at least attempting to talk
to each other (there is TCP traffic between the two), but the message is not
being sent ("Follow TCP Stream" in Wireshark shows nothing).

Can anybody see what I'm doing wrong here, or what I'm forgetting?

--Clay Shannon

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited.   If you are not the intended
recipient, please contact the sender and delete the material from any
computer.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to