This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; use Ada.Text_IO; | |
with GNAT.Sockets; use GNAT.Sockets; | |
with GNAT.Sockets.Friendly; use GNAT.Sockets.Friendly; | |
procedure Chatd is | |
type idcli is range 1..100; | |
type user(Connected : Boolean := false) is record | |
case Connected is | |
when False => null; | |
when True => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/select.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define BUFLEN 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
## | |
# TCP chat server | |
# port 1664 | |
## | |
from socket import * | |
from select import select | |
# create an TCP socket instance | |
s=socket(AF_INET, SOCK_STREAM) |