21 namespace Deveel.Data.Client {
29 private readonly String
host;
42 : base(initial_database) {
52 throw new DataException(
"Connection already established.");
56 socket =
new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
57 socket.Connect(host, port);
59 Setup(
new NetworkStream(socket, FileAccess.Read),
new NetworkStream(socket, FileAccess.Write));
60 }
catch (IOException e) {
61 throw new DataException(e.Message);
Connection to the database via the TCP protocol.
TCPStreamDatabaseInterface(String host, int port, string initial_database)
Socket socket
The Socket connection.
readonly String host
The name of the host we are connected to.
readonly int port
The port we are connected to.
void ConnectToDatabase()
Connects to the database.
An stream implementation of an interface to a database.