# problem with creating listening socket in bro

**URL:** <https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671>\
**Category:** Zeek\
**Created:** [May 3, 2013, 1:17pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671 "2013-05-03T13:17:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaafar\_Ahmed](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zaafar\_Ahmed](https://community.zeek.org/u/Zaafar_Ahmed)\
**Post date:** [May 3, 2013, 1:17pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/1 "2013-05-03T13:17:12Z")

</div>

Hello,

I was trying to create listening socket in bro via communication framework ( “base/frameworks/communication/main.bro” ). I run the above mention script after adding a Node in the nodes table, then I run netstat command to check if there is any listening port (default port) open but there isn’t.

Following is the output of communication.log file.

1367582532.150345 bro parent - - - info raised pipe’s socket buffer size from 224K to 1024K  
1367582532.150345 bro parent - - - info communication started, parent pid is 13482, child pid is 13484  
1367582538.673958 bro child - - - info selects=100000 canwrites=0 timeouts=100000  
1367582545.197614 bro child - - - info selects=200000 canwrites=0 timeouts=200000  
1367582551.720802 bro child - - - info selects=300000 canwrites=0 timeouts=300000  
1367582558.242728 bro child - - - info selects=400000 canwrites=0 timeouts=400000  
1367582564.762133 bro child - - - info selects=500000 canwrites=0 timeouts=500000

when I checked, what the above mentioned script was doing, it was calling enable\_communication function,

```auto
function enable_communication%(%): any

```

shouldn’t that script also call ‘listen’ function.

```auto
function listen%(ip: addr, p: port, ssl: bool, ipv6: bool, zone_id: string, retry_interval: interval%) : bool

```

maybe that’s the reason it isn’t opening listening port?

Regards,

zaafar

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [May 3, 2013, 2:23pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/2 "2013-05-03T14:23:31Z")

</div>

What did you put into the Communication::nodes table?

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![Zaafar\_Ahmed](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zaafar\_Ahmed](https://community.zeek.org/u/Zaafar_Ahmed)\
**Post date:** [May 3, 2013, 3:21pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/3 "2013-05-03T15:21:35Z")

</div>

I added localhost.  
redef Communication::nodes += { [“localhost”] = [$host=127.0.0.1] };

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [May 3, 2013, 3:39pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/4 "2013-05-03T15:39:14Z")

</div>

You can refer to base/frameworks/cluster/setup-connections.bro if you want to see some examples of Communication::nodes being configured.

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![Zaafar\_Ahmed](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zaafar\_Ahmed](https://community.zeek.org/u/Zaafar_Ahmed)\
**Post date:** [May 3, 2013, 3:58pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/5 "2013-05-03T15:58:16Z")

</div>

thanks, for pointing that out 🙂

Regards,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:40pm UTC](https://community.zeek.org/t/problem-with-creating-listening-socket-in-bro/2671/6 "2022-05-06T15:40:58Z")

</div>


