Windows Socket

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 29, 2013
Company:

Hi!

How can I connect to the "Windows Client Socket program" ?

 
#2
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear Burak Uyanık,

Please clarify:

- what task you want to perform

- what purpose you need to achieve by performing this task

Best regards,
Vladimir Gurov

1C Company support team
 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 29, 2013
Company:

Reading data from "Caller ID Device"

 
#4
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear Burak Uyanık,

Please let us know what is the purpose of getting this data in your application?

We ask in order to understand what you are going to do and why, and to offer you a solution.

Best regards,
Vladimir Gurov

1C Company support team
 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 29, 2013
Company:

Dear
Valdirimir Gurov

The Caller ID device is an IP socket based software.
This device shows incoming calls.
How can I communicate with the IP socket at 1C.

Example c# my project


using System;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Text;

namespace WindowsApplication1
{
   public partial class Form1 : Form
   {
       System.Net.Sockets.TcpClient clientSocket = new System.Net.Sockets.TcpClient();

       public Form1()
       {
           InitializeComponent();
       }

       private void Form1_Load(object sender, EventArgs e)
       {
           msg("Client Started");
           clientSocket.Connect("127.0.0.1", 8888);
           label1.Text = "Client Socket Program - Server Connected ...";
       }

       private void button1_Click(object sender, EventArgs e)
       {
           NetworkStream serverStream = clientSocket.GetStream();
           byte[] outStream = System.Text.Encoding.ASCII.GetBytes(textBox2.Text + "$");
           serverStream.Write(outStream, 0, outStream.Length);
           serverStream.Flush();

           byte[] inStream = new byte[10025];
           serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
           string returndata = System.Text.Encoding.ASCII.GetString(inStream);
           msg(returndata);
           textBox2.Text = "";
           textBox2.Focus();
       }

       public void msg(string mesg)
       {
           textBox1.Text = textBox1.Text + Environment.NewLine + " >> " + mesg;
       }
   }
}


Best regards

 
#6
People who like this:0Yes/0No
Interested
Rating: 16
Joined: Dec 4, 2017
Company:

Dear Burak Uyanık,

There are different approaches to achieve this. One of them is as follows:

By using the programming language you prefer (say, C#), you can first develop and build your own DLL that connects to the Caller ID device via sockets and implements the COM/Automation mechanism. And then you can address the DLL via COM from your 1C:Enterprise code (with the "New COMObject()" structure).

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.