# Problems using Sockets

**URL:** <https://discourse.julialang.org/t/problems-using-sockets/24212>\
**Category:** General Usage\
**Created:** [May 14, 2019, 3:27pm UTC](https://discourse.julialang.org/t/problems-using-sockets/24212 "2019-05-14T15:27:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfgang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wolfgang/32/13053_2.png) [@wolfgang](https://discourse.julialang.org/u/wolfgang)\
**Post date:** [May 14, 2019, 3:27pm UTC](https://discourse.julialang.org/t/problems-using-sockets/24212/1 "2019-05-14T15:27:26Z")

</div>

I have a problem using the sockets implementation of Julia. I’m trying to write a test program for a networking application and decided to do this in Julia instead of Python, since I am free to ue what I want and I want to learn Julia. I ran into a few problems, for most I found solutions, but I cannot find out how to bind() an outgoing TCP socket to a certain port, which is expected by the application under test:

`
**julia>** using Sockets
julia> u = UDPSocket()
UDPSocket(init)
julia> bind(u, IPv6(“fd00::104e:eff3:1076:d956”), 19991)
true
julia> t = TCPSocket()
TCPSocket(RawFD(0xffffffff) init, 0 bytes waiting)
julia> bind(t, IPv6(“fd00::104e:eff3:1076:d956”), 19992)
ERROR: MethodError: no method matching bind(::TCPSocket, ::IPv6, ::Int64)
Closest candidates are:
bind(::Union{TCPServer, UDPSocket}, ::IPAddr, ::Integer; ipv6only, reuseaddr, kws…) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Sockets/src/Sockets.jl:230
Stacktrace:
`

`[1] top-level scope at none:0
`

I would appreciate any help and pointers to any non trivial networking application written in Julia.
