ComposantsComponents › InternetInternet
Attend sur un port TCP qu'un autre programme se connecte, en général le tSocketOutput d'un autre job, puis lit les lignes délimitées qu'il envoie (comme un fichier CSV) et en fait un flux, jusqu'à ce que l'envoyeur ferme la connexion. C'est le composant qui écoute : il doit être prêt avant l'envoi. Il ne reçoit qu'une connexion par exécution, sans chiffrement ni authentification. Waits on a TCP port for another program to connect, usually the tSocketOutput of another job, then reads the delimited rows it sends (like a CSV file) and turns them into a flow, until the sender closes the connection. This is the component that listens: it must be ready before the sending. It receives a single connection per run, without encryption or authentication.
EntréeInput
Aucune : il commence un sous-job. Sinon un lien Iterate (une réception par itération). None: it starts a subjob. Otherwise one Iterate link (one reception per iteration).
SortieOutput
Main les lignes reçues, selon le schéma. Reject celles qui ne s'y convertissent pas (sans Arrêter en cas d'erreur). Ou Iterate. Main the received rows, following the schema. Reject those that cannot be converted to it (without Die on error). Or Iterate.
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Lancé le premier : il attend une connexion pendant le Délai avant expiration. Un autre job, sur la même machine ou une autre, envoie les lignes avec un tSocketOutput vers ce port. Started first: it waits for a connection during the Timeout. Another job, on the same machine or another one, sends the rows with a tSocketOutput to this port.
Deux sous-jobs qui tournent en même temps : cochez Exécution multi thread dans les réglages du job (page Extra), ou partez d'un tParallelize. Sans cela, le premier sous-job attend une connexion que le second n'enverra qu'après lui. Two subjobs that run at the same time: check Multi thread execution in the job settings (Extra page), or start from a tParallelize. Without that, the first subjob waits for a connection that the second one will only send after it.
"127.0.0.1" (voir Sécurité).
Choose the Port and, when the sender is on the same machine, check the host name binding with "127.0.0.1" (see Security).
Les libellés sont ceux de l'onglet Composant, dans son ordre ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Le composant n'a pas de paramètres avancés propres. Les séparateurs, le caractère d'échappement et l'entourage sont des textes entre guillemets d'un seul caractère. Labels are those of the Component tab, in its order; the technical name, in grey, is the parameter name in the job file. The component has no advanced settings of its own. The separators, the escape character and the enclosure are texts in quotes of a single character.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Lier le nom de l'hôte (s'il y a plus d'une addrese IP du côté de ce serveur)Bind host name (when more than 1 IP address in this sever side)BIND_HOSTNAME | NonNo | ToujoursAlways | Décochée : le port est ouvert sur toutes les adresses de la machine, réseau compris. Cochée : seulement sur l'adresse du Nom d'hôte. Unchecked: the port is opened on all the addresses of the machine, network included. Checked: only on the address of the Host name. |
| Nom d'hôteHost nameSERVERHOSTNAME | "127.0.0.1" |
Liaison cochéeBinding checked |
Adresse (ou nom) de cette machine sur laquelle écouter : "127.0.0.1" pour un envoyeur sur la même machine, l'adresse de la carte réseau voulue sinon. Lors de nos essais, netstat a montré TCP 127.0.0.1:51247 0.0.0.0:0 LISTENING.
Address (or name) of this machine to listen on: "127.0.0.1" for a sender on the same machine, the address of the wanted network card otherwise. In our runs, netstat showed TCP 127.0.0.1:51247 0.0.0.0:0 LISTENING.
|
| PortPORT | 3456 |
ToujoursAlways |
Port TCP d'écoute, expression Java entière. Déjà pris : le composant échoue sur java.net.BindException: Address already in use: bind.
TCP port to listen on, integer Java expression. Already taken: the component fails on java.net.BindException: Address already in use: bind.
|
| Délai avant expirationTimeoutTIMEOUT | 6000 |
ToujoursAlways |
Attente maximale de la connexion, en millisecondes ; au-delà, le composant échoue sur Accept timed out. Vide ou 0 : attente sans limite. Il ne vaut pas pour la lecture : une fois connecté, un envoyeur qui se tait est attendu sans fin.
Maximum wait for the connection, in milliseconds; beyond that, the component fails on Accept timed out. Empty or 0: wait without a limit. It does not apply to reading: once connected, a silent sender is waited for forever.
|
| DécompresserUncompressUNCOMPRESS | NonNo | ToujoursAlways | À cocher quand le tSocketOutput a Compresser coché : chaque champ est décodé (Base64) puis décompressé (zip). Un champ qui n'est pas ainsi codé fait échouer le composant, même sans Arrêter en cas d'erreur. To check when the tSocketOutput has Compress checked: each field is decoded (Base64) then uncompressed (zip). A field that is not coded this way makes the component fail, even without Die on error. |
| Arrêter en cas d'erreurDie on errorDIE_ON_ERROR | NonNo | ToujoursAlways | Pour une ligne dont une valeur ne se convertit pas au type de sa colonne. Décochée : la ligne part dans le lien Reject s'il existe, sinon son message est écrit sur la sortie d'erreur et elle est écartée. Cochée : le composant échoue (le lien Reject disparaît). For a row whose value cannot be converted to the type of its column. Unchecked: the row goes to the Reject link when there is one, otherwise its message is written to the error output and it is dropped. Checked: the component fails (the Reject link disappears). |
| Séparateur de lignesRow separatorROWSEPARATOR | "\n" |
ToujoursAlways |
"\n" ou "\r" : les fins de ligne habituelles, \r\n comprises. Un autre caractère ("#") : ce caractère. Deux caractères ("\r\n") ne compilent pas.
"\n" or "\r": the usual line ends, \r\n included. Another character ("#"): that character. Two characters ("\r\n") do not compile.
|
| Séparateur de champsField separatorFIELDSEPARATOR | ";" |
ToujoursAlways |
Un caractère : ";", "|", "\t".
One character: ";", "|", "\t".
|
| Caractère d'échappementEscape CharESCAPE_CHAR | "\"" |
ToujoursAlways |
Deux réglages seulement sont lus : "\\" (barre oblique inverse devant le guillemet) ; tout autre caractère est remplacé par l'Entourage du texte, doublé dans la valeur ("").
Only two settings are read: "\\" (backslash before the quote); any other character is replaced with the Text Enclosure, doubled in the value ("").
|
| Entourage du texteText EnclosureTEXT_ENCLOSURE | "\"" |
ToujoursAlways | Caractère qui entoure les valeurs ; une valeur entourée peut contenir le séparateur. Vide : aucun entourage. Character around the values; an enclosed value can hold the separator. Empty: no enclosure. |
| SchémaSchemaSCHEMA | videempty | ToujoursAlways |
Les colonnes, dans l'ordre des champs reçus. Un champ vide donne "" pour une String, null pour les autres types (ou la valeur par défaut d'un type non nullable). Une Date se lit avec le motif de sa colonne. Le schéma Reject reprend ces colonnes plus errorCode et errorMessage.
The columns, in the order of the received fields. An empty field gives "" for a String, null for the other types (or the default value of a non-nullable type). A Date is read with the pattern of its column. The Reject schema takes these columns plus errorCode and errorMessage.
|
| EncodageEncodingENCODING | "ISO-8859-15" |
ToujoursAlways | Encodage des octets reçus : le même que celui du tSocketOutput (voir L'encodage). Encoding of the received bytes: the same as the one of the tSocketOutput (see Encoding). |
((Integer) globalMap.get("tSocketInput_1_NB_LINE"))
socket connected dans la console du job et lit les lignes au fur et à mesure qu'elles arrivent ; les lignes vides sont ignorées.
At the first connection, it writes socket connected to the job console and reads the rows as they arrive; empty rows are skipped.
NB_LINE est rangé et les liens suivants partent. Il n'accepte pas d'autre connexion : un second envoyeur, même connecté pendant la lecture du premier, perd ses lignes sans erreur (voir Pièges).
When the sender closes the connection, it closes the port and ends: NB_LINE is stored and the next links start. It does not accept another connection: a second sender, even connected while the first one is being read, loses its rows without an error (see Pitfalls).
Les sorties sont copiées depuis des exécutions des jobs de Utilisation (lancés depuis Talaxie, Java 21), sur une seule machine. Réglages communs : liaison cochée sur "127.0.0.1", Port 3456, Délai avant expiration 20000, tLogRow en mode Table. Les tJava reliés par On Subjob Ok affichent NB_LINE, celui relié par On Component Error le message. Les lignes envoyées par le tFixedFlowInput, schéma id (Integer), name, city, since (Date, motif "yyyy-MM-dd"), le même des deux côtés :
The outputs are copied from runs of the jobs of Usage (started from Talaxie, Java 21), on a single machine. Common settings: binding checked on "127.0.0.1", Port 3456, Timeout 20000, tLogRow in Table mode. The tJava connected with On Subjob Ok print NB_LINE, the one connected with On Component Error the message. The rows sent by the tFixedFlowInput, schema id (Integer), name, city, since (Date, pattern "yyyy-MM-dd"), the same on both sides:
id name city since
1 "Zoé" "Lyon" TalendDate.parseDate("yyyy-MM-dd", "2026-01-15")
2 "Grace; \"Amazing\"" "New York" TalendDate.parseDate("yyyy-MM-dd", "2025-06-01")
3 "Ada" null null
Exécution multi thread cochée ; tSocketOutput avec ses réglages par défaut (10 essais espacés de 1 000 ms). Multi thread execution checked; tSocketOutput with its default settings (10 tries 1,000 ms apart).
socket connected tSocketOutput_1 NB_LINE = 3 .--+----------------+--------+----------. | tLogRow_1 | |=-+----------------+--------+---------=| |id|name |city |since | |=-+----------------+--------+---------=| |1 |Zoé |Lyon |2026-01-15| |2 |Grace; "Amazing"|New York|2025-06-01| |3 |Ada | |null | '--+----------------+--------+----------' tSocketInput_1 NB_LINE = 3
Le point-virgule et les guillemets du nom passent grâce à l'entourage. La ville null arrive en chaîne vide, la date null reste null. Le tLogRow n'affiche sa table qu'à la fin, après la sortie du sous-job d'envoi.
The semicolon and the quotes of the name go through thanks to the enclosure. The null city arrives as an empty string, the null date stays null. The tLogRow only prints its table at the end, after the output of the sending subjob.
Le job qui reçoit, lancé 1,5 s avant le job qui envoie (tFixedFlowInput_1 → tSocketOutput_1, puis un tJava). Console du job qui reçoit : The job that receives, started 1.5 s before the job that sends (tFixedFlowInput_1 → tSocketOutput_1, then a tJava). Console of the job that receives:
socket connected .--+----------------+--------+----------. | tLogRow_1 | |=-+----------------+--------+---------=| |id|name |city |since | |=-+----------------+--------+---------=| |1 |Zoé |Lyon |2026-01-15| |2 |Grace; "Amazing"|New York|2025-06-01| |3 |Ada | |null | '--+----------------+--------+----------' tSocketInput_1 NB_LINE = 3
Console du job qui envoie : Console of the job that sends:
tSocketOutput_1 NB_LINE = 3
Le job parallèle, avec un lien Reject vers un second tLogRow. L'envoyeur a un schéma id, name en String et envoie "1", "two", "3" ; le tSocketInput lit id en Integer.
The parallel job, with a Reject link to a second tLogRow. The sender has an id, name schema in String and sends "1", "two", "3"; the tSocketInput reads id as Integer.
socket connected tSocketOutput_1 NB_LINE = 3 .--+----. |tLogRow_1| |=-+---=| |id|name| |=-+---=| |1 |Ada | |3 |Zoé | '--+----' .--+----+---------+---------------------------------. | tLogRow_2 | |=-+----+---------+--------------------------------=| |id|name|errorCode|errorMessage | |=-+----+---------+--------------------------------=| |null|null|null |For input string: "two" - Line: 1| '--+----+---------+---------------------------------' tSocketInput_1 NB_LINE = 2
Le rejet ne garde pas les valeurs reçues (name est vide alors que Grace a été envoyé) et errorCode n'est pas rempli. Le numéro de Line est le nombre de lignes lues avant elle, rejets compris : la deuxième ligne reçue porte 1. Sans lien Reject, la console a montré For input string: "two" et la ligne a été écartée ; avec Arrêter en cas d'erreur, le composant a échoué sur java.lang.NumberFormatException: For input string: "two".
The reject does not keep the received values (name is empty although Grace was sent) and errorCode is not filled. The Line number is the number of rows read before it, rejects included: the second row received bears 1. Without a Reject link, the console showed For input string: "two" and the row was dropped; with Die on error, the component failed on java.lang.NumberFormatException: For input string: "two".
Le job qui reçoit seul, Délai avant expiration 3000. Nom du job remplacé par MyJob, pile abrégée :
The job that receives alone, Timeout 3000. Job name replaced with MyJob, shortened stack:
Exception in component tSocketInput_1 (MyJob) java.net.SocketTimeoutException: Accept timed out at java.base/sun.nio.ch.NioSocketImpl.timedAccept(NioSocketImpl.java:701) … at demo.myjob_0_1.MyJob.tSocketInput_1Process(MyJob.java:1088) … On Component Error: ERROR_MESSAGE = Accept timed out
Le tJava relié par On Subjob Ok ne s'exécute pas. Attention : après ce délai dépassé, le port reste occupé jusqu'à la fin du job (voir Pièges). The tJava connected with On Subjob Ok does not run. Beware: after this timeout, the port stays taken until the end of the job (see Pitfalls).
Délai avant expiration 2000. Un petit programme d'essai se connecte tout de suite, attend 5 s, envoie deux lignes puis ferme :
Timeout 2000. A small test program connects at once, waits 5 s, sends two rows then closes:
socket connected .--+-----+-----+----------. | tLogRow_1 | |=-+-----+-----+---------=| |id|name |city |since | |=-+-----+-----+---------=| |1 |Ada |Paris|2026-01-15| |2 |Grace|Rome |2025-06-01| '--+-----+-----+----------' tSocketInput_1 NB_LINE = 2
Les 5 s de silence ont été attendues malgré le délai de 2 s : il ne vaut que pour l'arrivée de la connexion. Un envoyeur bloqué sans fermer la connexion bloque donc le job qui reçoit. The 5 s of silence were waited for despite the 2 s timeout: it only applies to the arrival of the connection. A stuck sender that does not close the connection thus blocks the job that receives.
Rien ne vérifie que l'envoyeur et le receveur ont les mêmes réglages. Le job parallèle, avec ce qui change : Nothing checks that the sender and the receiver have the same settings. The parallel job, with what changes:
tSocketOutput en "UTF-8", tSocketInput en "ISO-8859-15" (défaut). Villes envoyées : Kraków et Łódź 10 €.
tSocketOutput in "UTF-8", tSocketInput in "ISO-8859-15" (default). Cities sent: Kraków and Łódź 10 €.
.--+----+--------------+-----. | tLogRow_1 | |=-+----+--------------+----=| |id|name|city |since| |=-+----+--------------+----=| |1 |Zoé|Kraków |null | |2 |Ada |Åódź 10 â¬|null | '--+----+--------------+-----'
"ISO-8859-15" des deux côtés, mêmes villes.
"ISO-8859-15" on both sides, same cities.
.--+----+---------+-----. | tLogRow_1 | |=-+----+---------+----=| |id|name|city |since| |=-+----+---------+----=| |1 |Zoé |Kraków |null | |2 |Ada |?ód? 10 €|null | '--+----+---------+-----'
Le « Ł » et le « ź », absents de l'ISO-8859-15, sont remplacés par ? à l'envoi. Choisissez "UTF-8" des deux côtés.
The "Ł" and the "ź", missing from ISO-8859-15, are replaced with ? when sent. Choose "UTF-8" on both sides.
Entourage du texte "" des deux côtés, les trois lignes du début.
Text Enclosure "" on both sides, the three rows of the start.
socket connected tSocketOutput_1 NB_LINE = 3 .--+----+----+----------. | tLogRow_1 | |=-+----+----+---------=| |id|name|city|since | |=-+----+----+---------=| |1 |Zoé |Lyon|2026-01-15| |3 |Ada | |null | '--+----+----+----------' tSocketInput_1 NB_LINE = 2 Unparseable date: "New York"
Le point-virgule de Grace; "Amazing" a coupé la valeur : les champs se sont décalés et la ligne a été écartée. Sans entourage, aucune valeur ne doit contenir le séparateur.
The semicolon of Grace; "Amazing" cut the value: the fields shifted and the row was dropped. Without enclosure, no value may hold the separator.
Compresser et Décompresser cochées : les trois lignes sont arrivées telles qu'à la première exécution. Avec en plus l'entourage vide des deux côtés, le composant a échoué (pile abrégée) : Compress and Uncompress checked: the three rows arrived as in the first run. With, in addition, an empty enclosure on both sides, the component failed (shortened stack):
socket connected tSocketOutput_1 NB_LINE = 3 Exception in component tSocketInput_1 (MyJob) java.io.EOFException at java.base/java.util.zip.ZipInputStream.readFully(ZipInputStream.java:637) … On Component Error: ERROR_MESSAGE = java.io.EOFException
Un champ compressé contient des retours à la ligne (voir tSocketOutput) : il faut l'entourage pour qu'il reste d'un seul tenant. A compressed field holds line breaks (see tSocketOutput): the enclosure is needed for it to stay in one piece.
Le composant accepte la première connexion qui arrive, sans vérifier qui l'ouvre, et les lignes circulent en clair sur le réseau (la compression n'est pas un chiffrement). Sans la liaison au nom d'hôte, le port est ouvert sur toutes les adresses de la machine : un poste du réseau qui se connecte le premier fournit les lignes à la place de l'envoyeur attendu, ou empêche la réception. The component accepts the first connection that arrives, without checking who opens it, and the rows travel in clear on the network (compression is not encryption). Without the host name binding, the port is opened on all the addresses of the machine: a machine of the network that connects first provides the rows instead of the expected sender, or prevents the reception.
Quand les deux jobs sont sur la même machine, cochez la liaison avec "127.0.0.1" (tous nos essais). Entre deux machines, réservez-le à un réseau de confiance, fermé par un pare-feu au reste du réseau, et contrôlez les lignes reçues (nombre de lignes attendu, schéma) avant de les utiliser. Pour des données sensibles, préférez un transfert chiffré et authentifié (fichier par SFTP avec tFTPPut, service web en HTTPS).
When both jobs are on the same machine, check the binding with "127.0.0.1" (all our runs). Between two machines, keep it for a trusted network, closed by a firewall to the rest of the network, and check the received rows (expected number of rows, schema) before using them. For sensitive data, prefer an encrypted and authenticated transfer (file over SFTP with tFTPPut, web service over HTTPS).
Dans le job parallèle, deux envois successifs vers le même tSocketInput, une ligne chacun ; un tJava affiche ensuite les NB_LINE des deux tSocketOutput :
In the parallel job, two successive sendings to the same tSocketInput, one row each; a tJava then prints the NB_LINE of both tSocketOutput:
socket connected tSocketOutput_1 NB_LINE = 1, tSocketOutput_2 NB_LINE = 1 .--+----+----+----------. | tLogRow_1 | |=-+----+----+---------=| |id|name|city|since | |=-+----+----+---------=| |1 |Zoé |Lyon|2026-01-15| '--+----+----+----------' tSocketInput_1 NB_LINE = 1
Le second envoi s'est connecté et a écrit sa ligne sans erreur, mais le tSocketInput, qui ne lit qu'une connexion, l'a perdue (deux exécutions, même résultat). Un envoi par tSocketInput : pour plusieurs envoyeurs, prévoyez un port et un tSocketInput chacun, et comparez les NB_LINE des deux bouts.
The second sending connected and wrote its row without an error, but the tSocketInput, which only reads one connection, lost it (two runs, same result). One sending per tSocketInput: for several senders, plan a port and a tSocketInput each, and compare the NB_LINE of both ends.
Deux tSocketInput sur le même port, délai de 2 s, personne ne se connecte : le second doit reprendre l'attente après l'échec du premier. Après le Accept timed out du premier (pile abrégée) :
Two tSocketInput on the same port, 2 s timeout, nobody connects: the second one should take over the wait after the failure of the first. After the Accept timed out of the first one (shortened stack):
Exception in component tSocketInput_2 (MyJob) java.net.BindException: Address already in use: bind at java.base/sun.nio.ch.Net.bind0(Native Method) … On Component Error: tSocketInput_2 ERROR_MESSAGE = Address already in use: bind
Quand le délai est dépassé, le composant ne ferme pas le port qu'il a ouvert : il reste pris jusqu'à la fin du job. Une boucle de nouvelles tentatives sur le même port (tLoop, On Subjob Error) ne marche donc pas : donnez un délai assez long, ou relancez le job. When the timeout is exceeded, the component does not close the port it opened: it stays taken until the end of the job. A loop of new tries on the same port (tLoop, On Subjob Error) thus does not work: give a long enough timeout, or start the job again.
Séparateurs, entourage et échappement sont placés dans le code généré entre apostrophes, comme un caractère Java : une valeur de deux caractères ("\r\n", ";;") fait échouer la compilation du job (unclosed character literal). Avec "\n", le composant reconnaît aussi les fins de ligne \r\n qu'envoie un tSocketOutput sous Windows.
Separators, enclosure and escape are put in the generated code between apostrophes, as a Java character: a two-character value ("\r\n", ";;") makes the compilation of the job fail (unclosed character literal). With "\n", the component also recognizes the \r\n line ends that a tSocketOutput sends on Windows.
socket connected est écrit à chaque réception, sans nom de composant. Les erreurs de conversion sans lien Reject sont écrites sur la sortie d'erreur sans retour à la ligne : plusieurs se suivent sur une même ligne. Le texte du composant dans la palette (« se connecte à un socket… jusqu'à réception du message de fermeture ») ne décrit pas ce qu'il fait : il écoute, et s'arrête à la fermeture de la connexion.
socket connected is written at each reception, without a component name. The conversion errors without a Reject link are written to the error output without a line break: several follow each other on the same line. The text of the component in the palette ("connects to a socket… until a closing message is received") does not describe what it does: it listens, and stops when the connection is closed.
Les autres composants de la famille Internet, et ceux qui servent avec le tSocketInput : The other components of the Internet family, and those used with the tSocketInput:
tSocketOutput · envoie les lignes au tSocketInputsends the rows to the tSocketInputtParallelize · lance réception et envoi en même tempsstarts reception and sending at the same timetRunJob · passe des lignes à un autre job du même projetpasses rows to another job of the same projecttBufferOutput · rend des lignes au job appelantgives rows back to the calling jobtFileInputDelimited · les mêmes options de séparateurs, pour un fichierthe same separator options, for a filetLogRow · affiche les lignes reçuesprints the received rows