From a7cdf049e82c57f26ff302bcf616bd86777394f4 Mon Sep 17 00:00:00 2001 From: Randil Date: Thu, 9 Jan 2025 14:24:52 +0530 Subject: [PATCH] Rename main.bal to chat_service.bal --- examples/tcp-chat-server/{main.bal => chat_service.bal} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename examples/tcp-chat-server/{main.bal => chat_service.bal} (97%) diff --git a/examples/tcp-chat-server/main.bal b/examples/tcp-chat-server/chat_service.bal similarity index 97% rename from examples/tcp-chat-server/main.bal rename to examples/tcp-chat-server/chat_service.bal index 6950cf4e..ddc24f47 100644 --- a/examples/tcp-chat-server/main.bal +++ b/examples/tcp-chat-server/chat_service.bal @@ -1,6 +1,6 @@ import ballerina/io; -import ballerina/tcp; import ballerina/lang.'string; +import ballerina/tcp; type ChatServer service object { map clients; @@ -51,7 +51,7 @@ service class ChatConnectionService { self.messageBuffer += message; if self.messageBuffer.includes("\n") { - string[] messages = re`\r?\n`.split(self.messageBuffer); + string[] messages = re `\r?\n`.split(self.messageBuffer); self.messageBuffer = messages[messages.length() - 1]; foreach string msg in messages.slice(0, messages.length() - 1) {