Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Windows Socket

Forum

Search UsersRules
Windows Socket
#1
Active user
Points:: 0
Joined:: Jan 29, 2013

Hi!

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

Profile
#2
Interested
Points:: 0
Joined:: Dec 4, 2017

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

Profile
#3
Active user
Points:: 0
Joined:: Jan 29, 2013

Reading data from "Caller ID Device"

Profile
#4
Interested
Points:: 0
Joined:: Dec 4, 2017

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

Profile
#5
Active user
Points:: 0
Joined:: Jan 29, 2013

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

Profile
#6
Interested
Points:: 0
Joined:: Dec 4, 2017

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

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.