tag:blogger.com,1999:blog-9219239911256456417.post7199810090106822795..comments2023-10-09T12:14:24.237+02:00Comments on Notes from a Swift developer: Socket Programming in Swift: Part 1 - getaddrinfoSwift developerhttp://www.blogger.com/profile/08961735669473819012noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-9219239911256456417.post-41594124432612314582017-10-02T12:02:34.522+02:002017-10-02T12:02:34.522+02:00Probably.
It is not clear to me where which devic...Probably.<br /><br />It is not clear to me where which device is in the setup you described.<br /><br />In general, when connecting a phone to -say- a laptop, the phone and the laptop must be on the same network. If you use a WIFI router/hub for that, then the WIFI hub will assign IP addresses to both phone and laptop.<br /><br />However, if you want the phone to connect to the laptop's WIFI then the laptop must be set up as a WIFI hub. Not all laptops will be able to do so.Swift developerhttps://www.blogger.com/profile/08961735669473819012noreply@blogger.comtag:blogger.com,1999:blog-9219239911256456417.post-66990408819155682822017-10-02T11:42:04.684+02:002017-10-02T11:42:04.684+02:00Hi
I want to connect to a device IP and then wri...Hi <br /><br />I want to connect to a device IP and then write on its port. Do I need to Connect the phone to device's WIFI and then connect to its IP and work with its ports??<br /><br />Anonymoushttps://www.blogger.com/profile/03289347738230501350noreply@blogger.comtag:blogger.com,1999:blog-9219239911256456417.post-16166110723544631422016-11-17T07:58:14.123+01:002016-11-17T07:58:14.123+01:00Thanks for catching that Matt. I have updated the ...Thanks for catching that Matt. I have updated the code.Swift developerhttps://www.blogger.com/profile/08961735669473819012noreply@blogger.comtag:blogger.com,1999:blog-9219239911256456417.post-75732290227473927672016-11-17T05:24:37.538+01:002016-11-17T05:24:37.538+01:00if status != 0 {
var strError: String
if s...if status != 0 {<br /> var strError: String<br /> if status == EAI_SYSTEM {<br /> strError = String(validatingUTF8: strerror(errno)) ?? "Unknown error code"<br /> } else {<br /> strError = String(validatingUTF8: gai_strerror(status)) ?? "Unknown error code"<br /> }<br /> print(strError)<br /> return<br />}<br /><br />This does not compile as return is outside a function<br />Anonymoushttps://www.blogger.com/profile/04014454618442793497noreply@blogger.com